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.0.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file opentelemetry-exporter-gcp-trace-1.0.0.tar.gz.

File metadata

  • Download URL: opentelemetry-exporter-gcp-trace-1.0.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for opentelemetry-exporter-gcp-trace-1.0.0.tar.gz
Algorithm Hash digest
SHA256 eec4ebc13309e44b9ff998360a1e60ac3469fd67baa71c1911463e1bedde9070
MD5 70a12d1c9834d15fbf17369bc93102db
BLAKE2b-256 092058d7bb7f668fcf1234f6e52c9243c994bf6fcb5869a591fb7e728549b7fe

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: opentelemetry_exporter_gcp_trace-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for opentelemetry_exporter_gcp_trace-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d9b0114b64fa1f6eedefaaca3703c225af71420f026bcc64a19bc7a5f0b866f
MD5 56545f58d69f822f459e93fce5e4c3db
BLAKE2b-256 eab66bef10d2fcf20747bd00b46d928075a871c6f4353cec6194db07a68fd5a6

See more details on using hashes here.

Provenance

Supported by

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