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
File details
Details for the file opentelemetry-exporter-cloud-trace-0.9b0.tar.gz
.
File metadata
- Download URL: opentelemetry-exporter-cloud-trace-0.9b0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a74c8988440830e850987cc8fc70ed5b0f19593ab5ad1e705290bcaf9fe7df5 |
|
MD5 | 8fa1b1e596407e4f277da5329ea83305 |
|
BLAKE2b-256 | 6d14caf8258c4f794034021203d279c14fb47734b26c608721bed5cce005544a |
File details
Details for the file opentelemetry_exporter_cloud_trace-0.9b0-py3-none-any.whl
.
File metadata
- Download URL: opentelemetry_exporter_cloud_trace-0.9b0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00567fd35eff7de9babd1513bbe4a5e333a445850c24c008730176793c338e9 |
|
MD5 | 2e2b417c2162787013b620cce1437eca |
|
BLAKE2b-256 | 389752f9e69406010dc3bb218a85bb84b424ac71cecc733e7da25270b706df91 |