Skip to main content

Google Cloud Trace exporter for OpenTelemetry

Project description

https://badge.fury.io/py/opentelemetry-exporter-gcp-trace.svg Documentation Status

This library provides support for exporting traces to Google Cloud Trace.

For resource detection and GCP trace context propagation, see opentelemetry-tools-google-cloud. For the Google Cloud Monitoring exporter, see opentelemetry-exporter-gcp-monitoring.

Installation

pip install opentelemetry-exporter-gcp-trace

Usage

from opentelemetry import trace
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
    SimpleSpanProcessor,
)

trace.set_tracer_provider(TracerProvider())

cloud_trace_exporter = CloudTraceSpanExporter(
    project_id='my-gcloud-project',
)
trace.get_tracer_provider().add_span_processor(
    SimpleSpanProcessor(cloud_trace_exporter)
)
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span('foo'):
    print('Hello world!')

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry-exporter-gcp-trace-1.1.0.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file opentelemetry-exporter-gcp-trace-1.1.0.tar.gz.

File metadata

  • Download URL: opentelemetry-exporter-gcp-trace-1.1.0.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for opentelemetry-exporter-gcp-trace-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b8d1c825df1a0adf77e17ee95534cfcf40626df204e681aac41509f6399e6a40
MD5 41c16dcda836656fe2a93b68f1689750
BLAKE2b-256 589a6d38ff4fcf6c5c17d2c1f3a18536b724208ca8ff5dc8c2cd225abd1b4ae2

See more details on using hashes here.

File details

Details for the file opentelemetry_exporter_gcp_trace-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: opentelemetry_exporter_gcp_trace-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0bb618ef186cdb5179909d689ea4e681826c00f79d852763fc8cb497c14ff4b
MD5 0ee5de9bcfcf4be011b68f31a45169d5
BLAKE2b-256 eede531b8bdd1347febae5a774b7f97f0a72e6e4387313fa5cc9ddfd21a27340

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page