elastic / elastic/apm-agent-python

Add instrumentation and distributed tracing for RabbitMQ (pika)

Abierto
#678 12 comentarios 14 reacciones 0 asignados Ver en GitHub
agent-python enhancement instrumentation
Lenguaje dominante
Python
Estrellas
431
Forks
239
Merge medio
5 d 10 h
PR fusionados (30 d)
7

Descripción

**Context**
One common way to integrate services is using RabbitMQ as a message broker. Currently, the Elastic APM agent only supports distributed tracing for HTTP calls. It would be of high value to add instrumentation and distributed tracing for message brokers and, in particular, [RabbitMQ](
https://www.rabbitmq.com/) - one of the most deployed open source message brokers. Not having this integration could be a show-stopper for users of competitor solutions ([New Relic already sports this integration](https://docs.newrelic.com/docs/agents/python-agent/getting-started/instrumented-python-packages#message-broker-clients)) when considering migrating to Elastic APM.

**Solution**
The ideal solution would be to instrument message publishing and include tracing data in message headers, interpreting those headers when consuming messages to continue the tracing.

To support the maximum number of projects using RabbitMQ, I would recommend to start by adding support for [Pika](https://pypi.org/project/pika/) - a widely-used AMQP client library having support for both Python 2.7 and +3.4.

**Alternatives**
A flexible alternative to a library-specific integration could be to provide APIs to create and interpret a distributed tracing payload for use in custom instrumentation of any type of communication between services. New Relic, for example, does offer these APIs in [`create_distributed_trace_payload()`](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/createdistributedtracepayload-python-agent-api) and [`accept_distributed_trace_payload()`](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/acceptdistributedtracepayload-python-agent-api)

I'm willing to contribute with code if this is of general interest.

/ Hampus

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

No se nombran archivos, pruebas ni puntos de entrada. Empieza revisando la compatibilidad existente del agente con HTTP distributed tracing y las rutas de publicación y consumo de Pika; después, determina si el trabajo debe ser específico de Pika o proporcionar payload APIs genéricas. El trabajo estará terminado cuando el contexto de trace se añada a los headers de los mensajes publicados y continúe cuando se consuman los mensajes.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, rabbitmq
Área
backend, distributed-systems
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.