Describe the bug
I create a metric view using the declarative configuration to include some labels via the included directive in the attributes_key block.
I haven't needed an excluded block so far.
meter_provider:
readers:
- periodic:
exporter:
otlp_http:
endpoint: http://localhost:4318/v1/metrics
views:
- selector:
instrument_name: http.server.request.duration
stream:
attribute_keys:
included:
- url.full
- http.request.method
- http.response.status_code
- error.type
- server.address
- server.port
- http.target
- http.path
- url.path
Now I wanted to test the latest version of the Java agent. With the new version 2.27.0, I now get the following error without an excluded block being set:
[otel.javaagent 2026-04-23 10:18:02:341 +0200] [main] INFO io.opentelemetry.exporter.internal.http.HttpExporter - Calling shutdown() multiple times.
OpenTelemetry Javaagent failed to start
io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: excluded must not be empty
at io.opentelemetry.sdk.autoconfigure.IncubatingUtil.toConfigurationException(IncubatingUtil.java:76)
at io.opentelemetry.sdk.autoconfigure.IncubatingUtil.create(IncubatingUtil.java:69)
at io.opentelemetry.sdk.autoconfigure.IncubatingUtil.configureFromFile(IncubatingUtil.java:39)
at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.maybeConfigureFromFile(AutoConfiguredOpenTelemetrySdkBuilder.java:598)
at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.buildImpl(AutoConfiguredOpenTelemetrySdkBuilder.java:450)
at io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder.build(AutoConfiguredOpenTelemetrySdkBuilder.java:431)
at io.opentelemetry.javaagent.tooling.OpenTelemetryInstaller.installOpenTelemetrySdk(OpenTelemetryInstaller.java:36)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:154)
at io.opentelemetry.javaagent.tooling.AgentInstaller.installBytebuddyAgent(AgentInstaller.java:101)
at io.opentelemetry.javaagent.tooling.AgentStarterImpl.start(AgentStarterImpl.java:102)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer$2.run(AgentInitializer.java:68)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer$2.run(AgentInitializer.java:61)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.execute(AgentInitializer.java:84)
at io.opentelemetry.javaagent.bootstrap.AgentInitializer.initialize(AgentInitializer.java:60)
at io.opentelemetry.javaagent.OpenTelemetryAgent.startAgent(OpenTelemetryAgent.java:59)
at io.opentelemetry.javaagent.OpenTelemetryAgent.premain(OpenTelemetryAgent.java:46)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:560)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:572)
Caused by: io.opentelemetry.javaagent.shaded.io.opentelemetry.api.incubator.config.DeclarativeConfigException: excluded must not be empty
at io.opentelemetry.sdk.extension.incubator.fileconfig.IncludeExcludeFactory.create(IncludeExcludeFactory.java:32)
at io.opentelemetry.sdk.extension.incubator.fileconfig.ViewFactory.create(ViewFactory.java:35)
at io.opentelemetry.sdk.extension.incubator.fileconfig.MeterProviderFactory.lambda$create$1(MeterProviderFactory.java:67)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at io.opentelemetry.sdk.extension.incubator.fileconfig.MeterProviderFactory.create(MeterProviderFactory.java:61)
at io.opentelemetry.sdk.extension.incubator.fileconfig.OpenTelemetryConfigurationFactory.create(OpenTelemetryConfigurationFactory.java:87)
at io.opentelemetry.sdk.extension.incubator.fileconfig.OpenTelemetryConfigurationFactory.create(OpenTelemetryConfigurationFactory.java:25)
at io.opentelemetry.sdk.extension.incubator.fileconfig.DeclarativeConfiguration.createAndMaybeCleanup(DeclarativeConfiguration.java:279)
at io.opentelemetry.sdk.extension.incubator.fileconfig.DeclarativeConfiguration.create(DeclarativeConfiguration.java:169)
at io.opentelemetry.sdk.extension.incubator.fileconfig.DeclarativeConfiguration.create(DeclarativeConfiguration.java:155)
at io.opentelemetry.sdk.autoconfigure.IncubatingUtil.create(IncubatingUtil.java:66)
... 18 more
The only workaround is to add any label to an excluded block.
Is this absolutely necessary with the new version? Or should the block actually remain optional?
Steps to reproduce
- use declarative configuration
- implement a view in meter_provider
- try to implement only a
included block in attribute_keys
- enable Debug Logging
- start Applikation with javaagent using declarative configuration
Expected behavior
It should be optional to implement an excluded Block, when using an included Block
Actual behavior
Without an excluded Block it is not possible to start the agent, if you want to included attributes.
Javaagent or library instrumentation version
2.27.0
Environment
JDK: openjdk 21.0.10 2026-01-20 LTS
OS: Red Hat Enterprise Linux 9.7
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Describe the bug
I create a metric view using the declarative configuration to include some labels via the
includeddirective in theattributes_keyblock.I haven't needed an
excludedblock so far.Now I wanted to test the latest version of the Java agent. With the new version 2.27.0, I now get the following error without an excluded block being set:
The only workaround is to add any label to an excluded block.
Is this absolutely necessary with the new version? Or should the block actually remain optional?
Steps to reproduce
includedblock in attribute_keysExpected behavior
It should be optional to implement an
excludedBlock, when using anincludedBlockActual behavior
Without an
excludedBlock it is not possible to start the agent, if you want to included attributes.Javaagent or library instrumentation version
2.27.0
Environment
JDK: openjdk 21.0.10 2026-01-20 LTS
OS: Red Hat Enterprise Linux 9.7
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.