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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb5c1025e79da8dccda51fc85c391256a18d6390cb7beff76cfd8a5b4426653 |
|
MD5 | 1bae1038dc006d61231b7f708b11314b |
|
BLAKE2b-256 | 906c358be59206dfa8c1beafc4a6f6f09218ad3e11f17d86dda43ba32ec28e12 |
Close
Hashes for opentelemetry_exporter_gcp_trace-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4c2be3ca06aa9cf3c15b2fd8b8d34456694fa58f09ded937740714897bf4f4 |
|
MD5 | 4e18ead08ce90c6ec4529dad2a9abba1 |
|
BLAKE2b-256 | 7e9d187ca69bb5d98cd58a5e10158f82bca74bcf48ec60261ade99d0cc619a37 |