Skip to content

Conversation

mosche
Copy link
Contributor

@mosche mosche commented Oct 13, 2025

Due to their mapping or cardinality, certain metric attributes are likely to cause issues.
Such attribute names are denied by a new assertion

Relates to ES-13074

Due to their mapping or cardinality, certain metric attributes are likely to cause issues.
Such attribute names are denied by a new assertion

Relates to ES-13074
@mosche mosche requested a review from a team October 13, 2025 13:17
@mosche mosche added >non-issue :Core/Infra/Metrics Metrics and metering infrastructure labels Oct 13, 2025
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team v9.3.0 labels Oct 13, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

);

// forbidden attributes known to cause issues due to mapping conflicts or high cardinality
static final Predicate<String> FORBIDDEN_ATTRIBUTE_NAMES = Regex.simpleMatcher(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBC this is just assuming the naming that a developer would use, but doesn't guarantee the same metric isn't used with a different name, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's two issues:

  • some fields get mapped to timestamps (see ES-13074), we have to prevent usage of these to prevent such metrics from being silently dropped at ingestion. such errors don't surface anywhere unfortunately.
  • high cardinality metrics, adding index here just as precaution for this not to happen again. i also tried to forbid *_id as it indicates some higher cardinality label but there's still two usages of it we have to fix first

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should change the interfaces to require metric names to be models as enums to prevent uncontrolled cardinality. Though, that's a massive change :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Metrics Metrics and metering infrastructure >non-issue Team:Core/Infra Meta label for core/infra team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants