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.

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.2.0.tar.gz (18.1 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.2.0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry-exporter-gcp-trace-1.2.0.tar.gz
Algorithm Hash digest
SHA256 341797181c4044c4d8d90c7a00883e7c6b312b9a523b5bde390bc0e3c53b8d50
MD5 0220be061c42a64b7c9efaceb68458e2
BLAKE2b-256 0c9cbef3656a6fb129224f7fc746cd05de08b4810763180802d12fbd2b902d4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41642fcb933164a06326536886f6b0026a2f61552d9562ae0c6c47198ab01e67
MD5 59ffdc6eb6a0daa9353cc45b52ebe274
BLAKE2b-256 976e03dab4a8b9b995ffef0fc15621b625d7dc6c65ebadca50872eeb99d515d3

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