Declarative config fails SDK creation when a resource attribute value is null
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
AttributeListFactory.addToBuilder() から始め、null の処理を、すでに null 値をスキップしている OtlpDeclarativeConfigUtil と比較します。YAML での null の動作について DeclarativeConfigurationParseTest を調べ、その後、null のリソース属性が無視され、SDK が正常に起動することを示すテストを追加します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
A resource.attributes entry whose value is null makes declarative config throw DeclarativeConfigException: attribute value is required but is null, and the SDK fails to start.
Steps to reproduce
Add this to a config file and leave SERVICE_VERSION unset:
resource:
attributes:
- name: service.version
value: ${SERVICE_VERSION}
An unquoted, undefined variable is substituted as YAML null (asserted by DeclarativeConfigurationParseTest). Writing value: null has the same effect.
What did you expect to see?
The entry is ignored and the SDK starts. The configuration schema says nullBehavior: the entry is ignored for AttributeNameValue.value (added in open-telemetry/opentelemetry-configuration#617), and the generated AttributeNameValueModel Javadoc in this repo says "Property must be present, but if null the entry is ignored."
What did you see instead?
AttributeListFactory.addToBuilder() (line 43) calls FileConfigUtil.requireNonNull on the value and throws. OTLP headers, which have the same schema rule, already skip null values (OtlpDeclarativeConfigUtil).
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-extension-declarative-config
Version: main @ 7f423cbb1
How did you reference these artifacts? N/A (built from source)
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A
- 主要言語
- Java
- スター
- 2.5k
- フォーク
- 1k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 75
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-java のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
open-telemetry/opentelemetry-java#8898 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-java#8896 ·
メンテナーはふだん 2 日以内に返信
-
ComposableProbabilitySampler description still uses the old ComposableTraceIdRatioBasedSampler nameオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-java#8885 ·
メンテナーはふだん 2 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-java#8843 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-java#8688 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-java の issue をすべて見る
似ている issue
-
area/frontend good first issue kind/cooldown
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
beehive-lab/TornadoVM#1151 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
FasterXML/jackson-dataformats-binary#823 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信