Skip to main content

Google Cloud Trace exporter for OpenTelemetry

Project description

https://badge.fury.io/py/opentelemetry-exporter-gcp-trace.svg Documentation Status

This library provides support for exporting traces to Google Cloud Trace.

To get started with instrumentation in Google Cloud, see Generate traces and metrics with Python.

To learn more about instrumentation and observability, including opinionated recommendations for Google Cloud Observability, visit Instrumentation and observability.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry_exporter_gcp_trace-1.8.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file opentelemetry_exporter_gcp_trace-1.8.0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.8.0.tar.gz
Algorithm Hash digest
SHA256 b0dd95228567da814ac638da8c66f5aaeac384df55f6b0da2c6e5fb93ca2a8c8
MD5 706612b1c2dfd3c0a7e14d652211fc1e
BLAKE2b-256 afd9f428c0787adf93776f6341802efcca239d72cd1d1ce41d0bf861d9827cec

See more details on using hashes here.

File details

Details for the file opentelemetry_exporter_gcp_trace-1.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffd4fe9c78683b4e70f0f59df7e9e76c65dcf9b928decfdb4da47facdad26871
MD5 30b164d7ab58f83647ab3b7c38a6d8c9
BLAKE2b-256 8f2d4efb4682b7e9fd0bf3c23131b82db4d8c991696eb2d7e5d545963e6e50de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page