Cloud Trace integration for OpenTelemetry
Project description
This library provides classes for exporting trace data to Google Cloud Trace.
Installation
pip install opentelemetry-exporter-cloud-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 (
SimpleExportSpanProcessor,
)
trace.set_tracer_provider(TracerProvider())
cloud_trace_exporter = CloudTraceSpanExporter(
project_id='my-gcloud-project',
)
trace.get_tracer_provider().add_span_processor(
SimpleExportSpanProcessor(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-cloud-trace-0.10b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2544e8e77c3a38cc67ab4ef071adedf0326d67aecbc658d339de0fb213c319d5 |
|
MD5 | 5be6c2ee07b9b16ffcb31cb644a83c3f |
|
BLAKE2b-256 | 0ec7e3c2f0f655096a17b0dcd6a1a9fa10a344e3aad90f9976d8289e085a9758 |
Close
Hashes for opentelemetry_exporter_cloud_trace-0.10b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9f9d5992d30b843705a4ab8194b138c8fa1fda01d587796e44b4687c422fcd9 |
|
MD5 | aefa048c2a8e6b21fcddd446fc5d4a3b |
|
BLAKE2b-256 | ff882d6c0a2539bfb0fe09ef90b72d1b4efc98398e7e78e9b9084b11c8c4bb00 |