[opentelemetry-php-contrib] laravel: queue hooks fail with sem-conv 1.45 (undefined MessagingIncubatingAttributes::MESSAGING_SYSTEM)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, observability
Research direction
The failing reference is in src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php, lines 55, 63 and 71, which use MessagingIncubatingAttributes::MESSAGING_SYSTEM. Check the sem-conv 1.45 incubating class for MESSAGING_SYSTEM_NAME and its AWS SQS value constant. Done means the queue pre-hooks no longer throw and the messaging attributes are emitted; confirm it against a Redis push test under the Laravel instrumentation tests.
Written by the indexing model from the issue text.
Description
Describe your environment
- PHP 8.5.12,
ext-opentelemetry1.4.2 - Laravel 13.42.0, Horizon (Redis queues)
open-telemetry/opentelemetry-auto-laravel1.10.0, the latest releaseopen-telemetry/sem-conv1.45.0,open-telemetry/sdk1.16.1,open-telemetry/exporter-otlp1.5.0OTEL_PHP_AUTOLOAD_ENABLED=true,OTEL_TRACES_EXPORTER=otlp
Steps to reproduce
- Install
open-telemetry/opentelemetry-auto-laravel1.10.0. Itscomposer.jsonallowsopen-telemetry/sem-conv: ^1.38, so a normalcomposer updateresolvessem-conv1.45.0.sdk1.16.x also requiressem-conv ^1.45.0. - Dispatch any job to a Redis queue, for example
dispatch(new SomeJob).
What is the expected behavior?
The queue hooks create their spans with the messaging attributes, and the trace context propagates to the job.
What is the actual behavior?
Every push to the queue logs this warning, and no queue span is created:
PHP Warning: Illuminate\Queue\RedisQueue::pushRaw(): OpenTelemetry: pre hook threw exception, class=Illuminate\Queue\RedisQueue function=pushRaw message=Undefined constant OpenTelemetry\SemConv\Incubating\Attributes\MessagingIncubatingAttributes::MESSAGING_SYSTEM in Unknown on line 0
PHP Warning: Laravel\Horizon\RedisQueue::pushRaw(): OpenTelemetry: pre hook threw exception, class=Laravel\Horizon\RedisQueue function=pushRaw message=Undefined constant OpenTelemetry\SemConv\Incubating\Attributes\MessagingIncubatingAttributes::MESSAGING_SYSTEM in Unknown on line 0
The job itself is still pushed and processed. What is lost is the queue telemetry: the enqueue span and, through the same AttributesBuilder, the worker side as well.
Additional context
sem-conv1.45.0 no longer hasMessagingIncubatingAttributes::MESSAGING_SYSTEM; the incubating class now hasMESSAGING_SYSTEM_NAME(messaging.system.name). 1.44.0 still has the old constant.src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php(lines 55, 63 and 71 onmain) still usesMessagingIncubatingAttributes::MESSAGING_SYSTEM. The same applies toMESSAGING_SYSTEM_VALUE_AWS_SQS.- So
opentelemetry-auto-laravel1.10.0 is incompatible withsem-conv>= 1.45, although its constraint (^1.38) allows it.
Possible fixes:
- move the builder to the new attribute name,
MESSAGING_SYSTEM_NAME, keeping themessaging.systemkey if the old semantic is still wanted; - or cap the constraint at
sem-conv <1.45until it is updated.
Our workaround is to pin open-telemetry/sem-conv to 1.44.*. That also requires sdk 1.15.* and exporter-otlp 1.4.*, because sdk 1.16 requires sem-conv ^1.45.
- Dominant language
- PHP
- Stars
- 923
- Forks
- 234
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 35
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-php
-
Invalid numeric `OTEL_*` values abort initialization instead of falling backPossibly taken @gowtham-padala claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-php#2136 ·
Maintainers usually reply within 1 day
-
Requiring sdk package with Slim framework breaks PSR7 detectionPossibly taken @cjones-vultr claimed this 34 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-php#2078 · 1 comment ·
Maintainers usually reply within 1 day
-
bite sized help wanted
Difficulty 1/5 Under an hour Newbie friendliness 68/100
open-telemetry/opentelemetry-php#1902 · 1 comment · 3 reactions ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 56/100
open-telemetry/opentelemetry-php#2143 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
open-telemetry/opentelemetry-php#2137 ·
Maintainers usually reply within 1 day
All issues in open-telemetry/opentelemetry-php
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Icinga/icinga-notifications-web#653 ·
Maintainers usually reply within 1 day
-
MCP Bundle
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
15.0
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vimeo/psalm#14139 · 1 comment ·
Maintainers usually reply within 2 days
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day