Skip to main content

Instrument Open Telemetry tracing within the GCP PubSub library

Project description

Open Telemetry GCP PubSub Instrumentation for Python

This package provides automatic instrumentation for the google-cloud-pubsub client library.

Installation

pip install opentelemetry-instrumentation-pubsub

Usage

Initiate the instrumentor after configuring your Open Telemetry trace provider.

from google.cloud import pubsub_v1
from pubsub_opentelemetry import PubSubInstrumentationProvider


# Instrument PubSub
PubSubInstrumentationProvider().instrument()

# Publish creates a span with PubSub specific attributes
with pubsub_v1.PublisherClient() as publisher:
    publisher.publish(topic_name, b'My first message!')

# Subscribe propagates the context from the received message
with pubsub_v1.SubscriberClient() as subscriber:
    subscriber.subscribe(subscription_name, callback)

License

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

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-instrumentation-pubsub-0.0.1a6.tar.gz.

File metadata

File hashes

Hashes for opentelemetry-instrumentation-pubsub-0.0.1a6.tar.gz
Algorithm Hash digest
SHA256 b3c6fe6724513c3edcc869432e95dbe67ebc0524bc1ded1219ccd1fecfaf0d5a
MD5 2ea6db7a007525edb8fd3275f4baa045
BLAKE2b-256 5c252d97a7bf97cf3ce22c39ef5d6b265a8ce291d9a202bfb47c61a0624670ba

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_pubsub-0.0.1a6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_pubsub-0.0.1a6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c681086c7d9e5dbe9b4749ac5ac820f2317b1701ca0dcd5714a495ed13b9c0f0
MD5 05407904d67c3f84053739af8f79d0ab
BLAKE2b-256 94efaa9bee2637fd1b0473f02c44e8c72b00638b142e9d666caa45e1d4a26624

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