[opentelemetry-php-contrib] laravel: queue hooks fail with sem-conv 1.45 (undefined MessagingIncubatingAttributes::MESSAGING_SYSTEM)

Aperta Adatta ai principianti
#2,139 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@gowtham-padala ci sta già lavorando.

Dal 17/11/2026.

  • #772 di @gowtham-padala — aperta

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
Stack tecnologico
laravel, php, redis

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-opentelemetry 1.4.2
  • Laravel 13.42.0, Horizon (Redis queues)
  • open-telemetry/opentelemetry-auto-laravel 1.10.0, the latest release
  • open-telemetry/sem-conv 1.45.0, open-telemetry/sdk 1.16.1, open-telemetry/exporter-otlp 1.5.0
  • OTEL_PHP_AUTOLOAD_ENABLED=true, OTEL_TRACES_EXPORTER=otlp

Steps to reproduce

  1. Install open-telemetry/opentelemetry-auto-laravel 1.10.0. Its composer.json allows open-telemetry/sem-conv: ^1.38, so a normal composer update resolves sem-conv 1.45.0. sdk 1.16.x also requires sem-conv ^1.45.0.
  2. 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-conv 1.45.0 no longer has MessagingIncubatingAttributes::MESSAGING_SYSTEM; the incubating class now has MESSAGING_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 on main) still uses MessagingIncubatingAttributes::MESSAGING_SYSTEM. The same applies to MESSAGING_SYSTEM_VALUE_AWS_SQS.
  • So opentelemetry-auto-laravel 1.10.0 is incompatible with sem-conv >= 1.45, although its constraint (^1.38) allows it.

Possible fixes:

  • move the builder to the new attribute name, MESSAGING_SYSTEM_NAME, keeping the messaging.system key if the old semantic is still wanted;
  • or cap the constraint at sem-conv <1.45 until 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-php

Tutte le issue di open-telemetry/opentelemetry-php

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.