[opentelemetry-php-contrib] laravel: queue hooks fail with sem-conv 1.45 (undefined MessagingIncubatingAttributes::MESSAGING_SYSTEM)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, observability
Direzione di ricerca
Il riferimento che fallisce si trova in src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php, alle righe 55, 63 e 71, che usano MessagingIncubatingAttributes::MESSAGING_SYSTEM. Verifica nella classe incubating di sem-conv 1.45 la costante MESSAGING_SYSTEM_NAME e la relativa costante di valore per AWS SQS. Il lavoro è completato quando i pre-hook delle code non generano più eccezioni e vengono emessi gli attributi di messaggistica; conferma con un test di push su Redis nei test dell'instrumentazione Laravel.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- PHP
- Stelle
- 923
- Fork
- 234
- Merge medio
- 1g 20h
- PR unite (30g)
- 35
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-telemetry/opentelemetry-php
-
Invalid numeric `OTEL_*` values abort initialization instead of falling backForse già presa @gowtham-padala l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-php#2136 ·
I maintainer di solito rispondono entro 1 giorno
-
Requiring sdk package with Slim framework breaks PSR7 detectionForse già presa @cjones-vultr l’ha presa 34 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-php#2078 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bite sized help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
open-telemetry/opentelemetry-php#1902 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
open-telemetry/opentelemetry-php#2143 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
open-telemetry/opentelemetry-php#2137 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di open-telemetry/opentelemetry-php
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Icinga/icinga-notifications-web#653 ·
I maintainer di solito rispondono entro 1 giorno
-
MCP Bundle
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
15.0
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vimeo/psalm#14139 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno