elastic / elastic/apm-agent-python

Add instrumentation and distributed tracing for RabbitMQ (pika)

Ouverte
#678 12 commentaires 14 réactions 0 personnes assignées Voir sur GitHub
agent-python enhancement instrumentation
Langage dominant
Python
Étoiles
431
Forks
239
Merge moyen
5 j 10 h
PR mergées (30 j)
7

Description

**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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Aucun fichier, test ou point d’entrée n’est nommé. Commencez par examiner la prise en charge existante du distributed tracing HTTP par l’agent ainsi que les chemins de publication et de consommation de Pika, puis déterminez si le travail doit être spécifique à Pika ou fournir des payload APIs génériques. Le travail est terminé lorsque le contexte de trace est ajouté aux headers des messages publiés et propagé lors de la consommation des messages.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, rabbitmq
Domaine
backend, distributed-systems
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.