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)
Development
Install dependencies:
make install
Run lint checks:
make lint
Run unit tests:
make test
Run tests against supported Python versions (using tox):
make tox
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opentelemetry-instrumentation-pubsub-0.0.1b3.tar.gz.
File metadata
- Download URL: opentelemetry-instrumentation-pubsub-0.0.1b3.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b0c1f8940a4794e2c1c97b27a15bd68f3e7ff62dcb026d084b8803edfd17d01
|
|
| MD5 |
dd133c7d606b3183992b77809c681c89
|
|
| BLAKE2b-256 |
073081943a38d831ce73c04ae9afc7a1764b103eaf6a7cb81810e4126d2ae1cd
|
File details
Details for the file opentelemetry_instrumentation_pubsub-0.0.1b3-py2.py3-none-any.whl.
File metadata
- Download URL: opentelemetry_instrumentation_pubsub-0.0.1b3-py2.py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0125706a7d6856fd52e2e5168b774533743c51aec04ae9e666eb4eb68f2d3d94
|
|
| MD5 |
0f63bb0aa9ab689f67ecd65c8f1b0328
|
|
| BLAKE2b-256 |
12e843a79b2fc72debcec620975899ff7f4a8d0bf5d52dd00aa59343f5e1e31e
|