[opentelemetry-php-contrib] laravel: queue hooks fail with sem-conv 1.45 (undefined MessagingIncubatingAttributes::MESSAGING_SYSTEM)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, observability
調査の方向性
失敗している参照は 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-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.
- 主要言語
- PHP
- スター
- 923
- フォーク
- 234
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-php のほかの issue
-
Invalid numeric `OTEL_*` values abort initialization instead of falling back対応中かも @gowtham-padala が 1 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-php#2136 ·
メンテナーはふだん 1 日以内に返信
-
Requiring sdk package with Slim framework breaks PSR7 detection対応中かも @cjones-vultr が 34 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-php#2078 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bite sized help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
open-telemetry/opentelemetry-php#1902 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
open-telemetry/opentelemetry-php#2143 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
open-telemetry/opentelemetry-php#2137 ·
メンテナーはふだん 1 日以内に返信
open-telemetry/opentelemetry-php の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Icinga/icinga-notifications-web#653 ·
メンテナーはふだん 1 日以内に返信
-
MCP Bundle
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
15.0
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
vimeo/psalm#14139 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信