Declarative config fails SDK creation when a resource attribute value is null
Los mantenedores suelen responder en 2 días
Ya se ha fusionado un pull request relacionado.
- #8889 de @thswlsqls — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
Línea de trabajo
Comienza con AttributeListFactory.addToBuilder() y compara su manejo de null con OtlpDeclarativeConfigUtil, que ya omite los valores null. Inspecciona DeclarativeConfigurationParseTest para conocer el comportamiento de null en YAML y, a continuación, añade cobertura que demuestre que se ignora un atributo de recurso null y que el SDK se inicia correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 2.5k
- Forks
- 1k
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 59
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de open-telemetry/opentelemetry-java
-
OkHttpGrpcSender no longer logs retry attemptsPosiblemente ocupada @thswlsqls la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
open-telemetry/opentelemetry-java#8966 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
JdkHttpSender passes CompletionException instead of the original exception to onErrorPosiblemente ocupada @thswlsqls la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
open-telemetry/opentelemetry-java#8961 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Fix `otel.sdk.log.created` counting semanticsPosiblemente ocupada @anuraaga la tomó hace 83 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
open-telemetry/opentelemetry-java#8688 ·
Los mantenedores suelen responder en 2 días
-
Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
open-telemetry/opentelemetry-java#8982 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 1-2 días Aptitud para principiantes 56/100
open-telemetry/opentelemetry-java#8980 ·
Los mantenedores suelen responder en 2 días
Todos los issues de open-telemetry/opentelemetry-java
Issues similares
-
Good First Issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
hiero-ledger/hiero-sdk-java#3025 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
DogFooding
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
OpenAEV-Platform/openaev#8768 ·
Los mantenedores suelen responder en 1 día
-
Empty trash: cancelling the password prompt, then swiping one note restores every trashed noteAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
federicoiosue/Omni-Notes#1039 ·
-
type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
micronaut-projects/micronaut-core#14179 ·
Los mantenedores suelen responder en 1 día