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.10.0.tar.gz (18.6 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.10.0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.10.0.tar.gz
Algorithm Hash digest
SHA256 2c0f2bb69ba4272e984d6adb3225f1d51ed6897b03f6db854588ccae0f08157f
MD5 9e5fd41ced75be6e1d0350a5b2a3f4b6
BLAKE2b-256 c63838a75b0a8e64c27af63871ca03bb8fc111437f9273ddcc705b1f55b10f40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 766277704ebd86d0225cf734cd6d6c07c57ddb1d006bad5b3ede97e6d9018794
MD5 6d342dd7457cc2354021c8948ff7a245
BLAKE2b-256 e2951a108bb61ff162555f72f4dd1ac618b6b7fa0b888e36f82cf3ec5c640b7c

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