Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Declarative config fails SDK creation when a resource attribute value is null

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

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

まだ誰も着手していません。

評価

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

調査の方向性

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

環境構築

はじめの一歩

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

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

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

似ている issue

Java の issue をもっと見る

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

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