Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should attribute_keys in stream configuration support include/exclude syntax? #98

Closed
codeboten opened this issue Jun 17, 2024 · 4 comments · Fixed by #111
Closed

Should attribute_keys in stream configuration support include/exclude syntax? #98

codeboten opened this issue Jun 17, 2024 · 4 comments · Fixed by #111
Assignees
Labels
blocked:spec The issue is blocked on having spec language on the topic.

Comments

@codeboten
Copy link
Contributor

The specification states:

attribute_keys: This is, at a minimum, an allow-list of attribute keys for measurements captured in the metric stream. The allow-list contains attribute keys that identify the attributes that MUST be kept, and all other attributes MUST be ignored.

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.

@tsloughter
Copy link
Member

Erlang/Elixir only supports including attributes based on key as well.

@jack-berg
Copy link
Member

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.

@jack-berg
Copy link
Member

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:

https://github.com/open-telemetry/opentelemetry-specification/blame/0b3328bb17fa6f86af521f8d22dbbcddea2ac914/specification/metrics/sdk.md#L362-L368

@jack-berg jack-berg added the blocked:spec The issue is blocked on having spec language on the topic. label Aug 19, 2024
@jack-berg
Copy link
Member

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.

@codeboten codeboten self-assigned this Aug 19, 2024
codeboten added a commit to codeboten/opentelemetry-configuration that referenced this issue Aug 19, 2024
This updates the stream's `attribute_keys` configuration to an include/exclude style object that
currently only supports `included`. This is in hope to support `excluded` in the future once the
specification allows it.

Fixes open-telemetry#98

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:spec The issue is blocked on having spec language on the topic.
Development

Successfully merging a pull request may close this issue.

3 participants