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

Abierto Apto para principiantes
#2,139 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@gowtham-padala ya está trabajando en esto.

Desde el 17/11/2026.

  • #772 de @gowtham-padala — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
laravel, php, redis

Línea de trabajo

La referencia que falla está en src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php, en las líneas 55, 63 y 71, que usan MessagingIncubatingAttributes::MESSAGING_SYSTEM. Revisa en la clase incubating de sem-conv 1.45 la constante MESSAGING_SYSTEM_NAME y su constante de valor para AWS SQS. Se considera terminado cuando los pre-hooks de colas ya no lanzan excepciones y se emiten los atributos de mensajería; confírmalo con una prueba de push a Redis en las pruebas de la instrumentación de Laravel.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
923
Forks
234
Merge medio
1 d 20 h
PR fusionados (30 d)
35

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de open-telemetry/opentelemetry-php

Todos los issues de open-telemetry/opentelemetry-php

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.