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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ab070fac6331551dee80cd5e89c1a098096a8c7e19f78bee8f3b6b90e96d470 |
|
MD5 | 52d8df8b40e0d9b2d633cc82d7624c93 |
|
BLAKE2b-256 | 04aad64ba287dc883c9faf0dddf5d49cd494691fa864826d3ecd72e6d6b4260c |
Close
Hashes for opentelemetry_exporter_gcp_trace-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb34b568379dd8333279fdc8aff9b3e79c9cd5a039a7ebe712e81b6fa02350f0 |
|
MD5 | e2019cf126cf8e86f6f62219e10a80c2 |
|
BLAKE2b-256 | bf78fb4dddb70f38b3d58203cebf06a8a1e4b18e39228705ed06d1fc54bd9f3b |