Skip to main content

OpenTelemetry pika instrumentation

Project description

pypi

This library allows tracing requests made by the pika library.

Installation

pip install opentelemetry-instrumentation-pika

Usage

  • Start broker backend

docker run -p 5672:5672 rabbitmq
  • Run instrumented task

import pika
from opentelemetry.instrumentation.pika import PikaInstrumentor

PikaInstrumentor().instrument()

connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')
  • PikaInstrumentor also supports instrumentation of a single channel

import pika
from opentelemetry.instrumentation.pika import PikaInstrumentor

connection = pika.BlockingConnection(pika.URLParameters('amqp://localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')

pika_instrumentation = PikaInstrumentor()
pika_instrumentation.instrument_channel(channel=channel)


channel.basic_publish(exchange='', routing_key='hello', body=b'Hello World!')

pika_instrumentation.uninstrument_channel(channel=channel)
  • PikaInstrumentor also supports instrumentation without creating an object, and receiving a tracer_provider

PikaInstrumentor.instrument_channel(channel, tracer_provider=tracer_provider)

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

Built Distribution

File details

Details for the file opentelemetry-instrumentation-pika-0.25b2.tar.gz.

File metadata

  • Download URL: opentelemetry-instrumentation-pika-0.25b2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for opentelemetry-instrumentation-pika-0.25b2.tar.gz
Algorithm Hash digest
SHA256 71a07dd0dddb0842af0b4fd641a534668fcf27f5421763135616962ffe0d91b2
MD5 2bf8eb59752f6fded82b0b3cb0317444
BLAKE2b-256 57cdb273984d659808de117ea1a711d6f97078d3e829e40e724f1fac769a7e1b

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_pika-0.25b2-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_pika-0.25b2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ef6a9292f99aa0271cd947d220f2e8651f780f9b9bcd353d6694b156b198054
MD5 be496b6914133d819e2db6283bd67537
BLAKE2b-256 6e619316d5d95f4f1ea260fcdd5303fdc7bbf395a1a0dca4f31717233f9c6276

See more details on using hashes here.

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