Skip to main content

Instrument Open Telemetry tracing within the GCP PubSub library

Project description

Open Telemetry GCP PubSub Instrumentation for Python

CircleCI PyPi version

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.1a9.tar.gz.

File metadata

File hashes

Hashes for opentelemetry-instrumentation-pubsub-0.0.1a9.tar.gz
Algorithm Hash digest
SHA256 8ee01adbcf62e9127b9e689d42433575b251c780fefb72bdb0ed2df06e4179e7
MD5 ff52def192179468abdb99132b4e796d
BLAKE2b-256 96ee283dd2166dda3ad854be28df2bde6871e1bf6cbea57eaa540cc981258c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_pubsub-0.0.1a9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd1c6f667aa712312e84d144582f72f5d3e27c2bb94dc5710bf20df0fbc23143
MD5 bdd55f52c9046eda03bf800f0216cd31
BLAKE2b-256 2d92403beec052b52b9475743dceba9e0359216c0f3a2f8372f86e10836bcbb5

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