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.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d7b1105e39326ecb2bac041d1ed66c30946081a25fd0920d76d73917f03173d |
|
MD5 | 3900af44195bdfe4d7fc889fed205cde |
|
BLAKE2b-256 | 4eb077b57eff81c2522f40d807fc0b979b121bd0d0f6ce1bd69bfdf7cde2666c |
Close
Hashes for opentelemetry_exporter_gcp_trace-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d699e8fca66062eaa38c2392349aa00154f31d87052614842a0ffbac6130b220 |
|
MD5 | 1798eeeee90b21a7f499ea90cfff1cc6 |
|
BLAKE2b-256 | 3c688cc2e4ca94d53e84c1ac99121bd2828f71045b5c23c14837f3932bca1e14 |