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.9b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a74c8988440830e850987cc8fc70ed5b0f19593ab5ad1e705290bcaf9fe7df5 |
|
MD5 | 8fa1b1e596407e4f277da5329ea83305 |
|
BLAKE2b-256 | 6d14caf8258c4f794034021203d279c14fb47734b26c608721bed5cce005544a |
Close
Hashes for opentelemetry_exporter_cloud_trace-0.9b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00567fd35eff7de9babd1513bbe4a5e333a445850c24c008730176793c338e9 |
|
MD5 | 2e2b417c2162787013b620cce1437eca |
|
BLAKE2b-256 | 389752f9e69406010dc3bb218a85bb84b424ac71cecc733e7da25270b706df91 |