Closed codeboten closed 3 months ago
Erlang/Elixir only supports including attributes based on key as well.
As a general rule, I don't think the file configuration schema should invent things that aren't in the spec, even if many languages provide something beyond what is specified. If users (or language maintainers) want something more expressive, the correct route seems to be to get the language changed in the spec, then reflect those changes in file config schema. If we didn't do this, then we would be potentially overpromising what is actually configurable. For example, suppose a language only supports include syntax because that's what the spec recommends, and file config supported include AND exclude syntax. A user would be try to use that configuration and it wouldn't work. And it would be hard to convince the language maintainer to add support for the exclude syntax because the spec doesn't mention it.
As I say this, there are examples where the spec is vague and we might consider filling in the details. For example, OTLP retry config... The spec never tackled this and doesn't seem like it will in the short term future. Perhaps file config should wait for the spec to describe those properties, or perhaps the spec never described those properties because it was constrained to flat env vars.
Discussed and decided that this is blocked on additional spec language for a deny list.
For reference, here's what the spec currently states on the topic:
Can we redefine the property schema we have today to allow for a more seamless addition of an exclude list in the future? Should do so before stability.
The specification states:
But looking at the go implementation, an attribute filter can be specified either to include or exclude based on the attribute keys:
https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/metric/instrument.go#L146
I checked the python implementations, and it looks like that implementation only supports including attributes based on the keys.