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.7.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file opentelemetry_exporter_gcp_trace-1.7.0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.7.0.tar.gz
Algorithm Hash digest
SHA256 2752dacdd3fdbfd73079d5ac58fc68179758e76535690d479de2bfbe03646583
MD5 adb94502838466a95ee189ead9f2269e
BLAKE2b-256 d66934f50b5fee5e7d4ef573d2789eabb7c878a6fa80763eed74b5dacdfdd6c8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fd66256a0a7feb3d87334ec7981f2a477c63cb6d7696b1bc603f105293b06db
MD5 83f9014a5f98593b094811e87f04af4b
BLAKE2b-256 c3024a71ffb531e35b8d30b3cdfff385308d755e5d38b01efb63f8da3a7de6bc

See more details on using hashes here.

Provenance

Supported by

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