Google Cloud Trace exporter for OpenTelemetry
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for opentelemetry-exporter-gcp-trace-1.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863985dab2434e945d073b39d08f4213adae09b0e26ad82c3910a4081974327a |
|
MD5 | edd7efdafe792a4f6dbf14ccd0a6b07f |
|
BLAKE2b-256 | 91356d9076e3308a2c2e7090a01bfc446fef400efb11a7ca066cc3794dbcc82b |
Close
Hashes for opentelemetry_exporter_gcp_trace-1.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 230e72d3604599df8eaf3482fe1cde9ce538689e86b43a39e721175729f65126 |
|
MD5 | 190d60aa52a445ceb7c81dbeaef1a008 |
|
BLAKE2b-256 | 3bd56544fd3d5d9a495eac73c016fc9ee407cb85e443e9df5a8ded0dc14a53cc |