dd-trace-php icon indicating copy to clipboard operation
dd-trace-php copied to clipboard

[Feature] pecl-amqp integration

Open redpanda opened this issue 2 years ago • 1 comments

Describe the feature you'd like

As a developer, I'd like to have traces for application that use the pecl-amqp extension.

Is your feature request related to a problem?

Some PHP applications that uses the php-amqplib library are natively instrumented (thanks to this request), but it is not the case on other applications that uses pecl-amqp extension.

Describe alternatives you've considered

I considered to implement an custom instrumentation for pecl-amqp extension, but I would like to know if this feature could be integrated in the dd-trace-php package.

About the feature considered, I'm seeing something similar to the native php-amqlib instrumentation, we could instrumented the following methods:

AMQPExchange

  • AMQPExchange::declareExchange ?
  • AMQPExchange::declare
  • AMQPExchange::publish

AMQPQueue

  • AMQPQueue::ack
  • AMQPQueue::bind
  • AMQPQueue::cancel
  • AMQPQueue::consume
  • AMQPQueue::declareQueue?
  • AMQPQueue::declare
  • AMQPQueue::get
  • AMQPQueue::nack

AMQPConnection

  • AMQPConnection::connect
  • AMQPConnection::pconnect
  • AMQPConnection::reconnect

Additional context

Thank you in advance for considering the request feature and let me know if we can give a hand to develop the feature. 👍

redpanda avatar Oct 23 '23 17:10 redpanda

Hey @redpanda,

Would be certainly nice to have. It's right now not on top of the priority list, but we wouldn't object to a PR :-)

About the to be instrumented methods, it should basically mirror what the php-amqplib integration also instruments. So at a first glance, the list of to be instrumented methods looks correct.

It would need a comprehensive testsuite as well though, like https://github.com/DataDog/dd-trace-php/blob/master/tests/Integrations/AMQP/AMQPTest.php.

bwoebi avatar Oct 24 '23 16:10 bwoebi