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

オープン 初心者向け
#2,139 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@gowtham-padala がすでに取り組んでいます。

2026年11月17日 から。

  • #772 @gowtham-padala による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
laravel, php, redis

調査の方向性

失敗している参照は src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/AttributesBuilder.php の 55、63、71 行目にあり、MessagingIncubatingAttributes::MESSAGING_SYSTEM を使用しています。sem-conv 1.45 の incubating クラスで MESSAGING_SYSTEM_NAME と、AWS SQS の値の定数を確認してください。キューの pre-hook が例外を投げなくなり、messaging 属性が出力されていれば完了です。Laravel インストルメンテーションのテストで Redis への push テストを行い、確認してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
PHP
スター
923
フォーク
234
平均マージ
1日 20時間
マージ済み PR(30日)
35

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/opentelemetry-php のほかの issue

open-telemetry/opentelemetry-php の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。