PHPackages                             new999day/opentelemetry-auto-ext-amqp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. new999day/opentelemetry-auto-ext-amqp

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

new999day/opentelemetry-auto-ext-amqp
=====================================

OpenTelemetry auto-instrumentation for ext-amqp

v1.0(2y ago)08.6k↓29.7%12Apache-2.0PHPPHP ^8.0

Since May 3Pushed 1y agoCompare

[ Source](https://github.com/new999day/contrib-auto-ext-amqp)[ Packagist](https://packagist.org/packages/new999day/opentelemetry-auto-ext-amqp)[ Docs](https://opentelemetry.io/docs/php)[ RSS](/packages/new999day-opentelemetry-auto-ext-amqp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (2)

[![Releases](https://camo.githubusercontent.com/46e38a504120203bf7615645011bcf2bb834e03e8eb0bc8e0f4864c729fd5baf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656c65617365732d707572706c65)](https://github.com/opentelemetry-php/contrib-auto-ext-amqp/releases)[![Issues](https://camo.githubusercontent.com/b9b31135f113cdb6e2b662b4040276044ee0803567bc17688eaf4386f797ea50/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6973737565732d70696e6b)](https://github.com/open-telemetry/opentelemetry-php/issues)[![Source](https://camo.githubusercontent.com/e27dd1126a60abf1c26521d893d9f235ef342a76231c2428ddbc4651185bd626/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d636f6e747269622d677265656e)](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/ExtAmqp)[![Mirror](https://camo.githubusercontent.com/2f9050293ab0c0d9471e618215bc7417a63b6873c960e1605bddb69b1911fa4c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6972726f722d6f70656e74656c656d657472792d2d7068702d2d636f6e747269622d626c7565)](https://github.com/opentelemetry-php/contrib-auto-ext-amqp)[![Latest Version](https://camo.githubusercontent.com/78d025cc10b69f22c54dca0d65a4ab9b593fd644316ebd00f487581092e36ce8/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d74656c656d657472792f6f70656e74656c656d657472792d6175746f2d6578742d616d71702f762f756e737461626c65)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-ext-amqp/)[![Stable](https://camo.githubusercontent.com/ed8bee2cef3ac93c68c008fc7e316082a9fb20b620bc0f129a0a01e6c3c92b88/687474703a2f2f706f7365722e707567782e6f72672f6f70656e2d74656c656d657472792f6f70656e74656c656d657472792d6175746f2d6578742d616d71702f762f737461626c65)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-ext-amqp/)

This is a read-only subtree split of .

OpenTelemetry ext-amqp auto-instrumentation
===========================================

[](#opentelemetry-ext-amqp-auto-instrumentation)

Please read  for instructions on how to install and configure the extension and SDK.

Overview
--------

[](#overview)

Auto-instrumentation hooks are registered via composer, and spans will automatically be created for the following methods:

- `AMQPExchange::publish`
- `AMQPQueue::ack`
- `AMQPQueue::nack`
- `AMQPQueue::reject`

The instrumentation automatically creates a span for each of the above methods and injects the span context into the message headers. A consumer *SHOULD* create a span for each message received, extract the span context and can decide to assume the context for processing the message or start a new trace and use trace-links to link the producer with the consumer.

### Example

[](#example)

```
//Create and declare channel
$channel = new AMQPChannel($connection);

$routing_key = 'task_queue';

$callback_func = function(AMQPEnvelope $message, AMQPQueue $q) {
    $context = $propagator->extract($message->getHeaders(), ArrayAccessGetterSetter::getInstance());
    $tracer = Globals::tracerProvider()->getTracer('my.org.consumer');

    // Start a new span that assumes the context that was injected by the producer
    $span = $tracer
        ->spanBuilder('my_queue consume')
        ->setSpanKind(SpanKind::KIND_CONSUMER)
        ->setParent($context)
        ->startSpan();

    sleep(sleep(substr_count($message->getBody(), '.')));

    $q->ack($message->getDeliveryTag());

    $span->end();
};

try{
    $queue = new AMQPQueue($channel);
    $queue->setName($routing_key);
    $queue->setFlags(AMQP_DURABLE);
    $queue->declareQueue();

    $queue->consume($callback_func);
} catch(AMQPQueueException $ex){
    print_r($ex);
} catch(Exception $ex){
    print_r($ex);
}

$connection->disconnect();
```

Full Example:

Configuration
-------------

[](#configuration)

The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):

```
OTEL_PHP_DISABLED_INSTRUMENTATIONS=ext_amqp
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88139aa12cf89a254709ddb926365dc26fa2895c5f4ce8fe429c8f19b273756c?d=identicon)[new999day](/maintainers/new999day)

---

Top Contributors

[![new999day](https://avatars.githubusercontent.com/u/11769803?v=4)](https://github.com/new999day "new999day (3 commits)")[![weslenteche](https://avatars.githubusercontent.com/u/54692047?v=4)](https://github.com/weslenteche "weslenteche (2 commits)")[![agoallikmaa](https://avatars.githubusercontent.com/u/3532037?v=4)](https://github.com/agoallikmaa "agoallikmaa (1 commits)")[![cedricziel](https://avatars.githubusercontent.com/u/418970?v=4)](https://github.com/cedricziel "cedricziel (1 commits)")[![xvilo](https://avatars.githubusercontent.com/u/390769?v=4)](https://github.com/xvilo "xvilo (1 commits)")

---

Tags

tracingopentelemetryotelioinstrumentationopen-telemetry

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/new999day-opentelemetry-auto-ext-amqp/health.svg)

```
[![Health](https://phpackages.com/badges/new999day-opentelemetry-auto-ext-amqp/health.svg)](https://phpackages.com/packages/new999day-opentelemetry-auto-ext-amqp)
```

###  Alternatives

[open-telemetry/opentelemetry-auto-symfony

OpenTelemetry auto-instrumentation for Symfony

551.2M1](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.2M1](/packages/open-telemetry-opentelemetry-auto-pdo)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
