This library allows tracing requests made by the FastStream library.
pip install opentelemetry-instrumentation-faststream
from opentelemetry.instrumentation.faststream.middlewares import RedisOtelMiddleware
broker = RedisBroker("redis://localhost:6379", middlewares=[RedisOtelMiddleware])
from opentelemetry.instrumentation.faststream.middlewares import KafkaOtelMiddleware
broker = KafkaBroker("redis://localhost:6379", middlewares=[KafkaOtelMiddleware])
from opentelemetry.instrumentation.faststream.middlewares import RabbitOtelMiddleware
broker = RabbitBroker("redis://localhost:6379", middlewares=[RabbitOtelMiddleware])
from opentelemetry.instrumentation.faststream.middlewares import NatsOtelMiddleware
broker = NatsBroker("redis://localhost:6379", middlewares=[NatsOtelMiddleware])
from opentelemetry.instrumentation.faststream import FastStreamInstrumentator
# Instrument all brokers automatically
FastStreamInstrumentator().instrument()
# Uninstrument
FastStreamInstrumentator().uninstrument()
opentelemetry-instrumentation-faststream
is distributed under the terms of the MIT license.