Skip to content

[exporter/elasticsearch] data loss due to incorrect metrics grouping #37898

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

Closed
carsonip opened this issue Feb 13, 2025 · 2 comments · Fixed by #37903
Closed

[exporter/elasticsearch] data loss due to incorrect metrics grouping #37898

carsonip opened this issue Feb 13, 2025 · 2 comments · Fixed by #37903
Labels
bug Something isn't working exporter/elasticsearch

Comments

@carsonip
Copy link
Contributor

carsonip commented Feb 13, 2025

Component(s)

exporter/elasticsearch

What happened?

Description

Metrics: in OTel mapping mode, data points are not grouped properly and may result in validation error within ES exporter. Regression from #37509 released in 0.119.0

Steps to Reproduce

create 2 data points from different resources but ends up in the same index

Expected Result

No error

Actual Result

validation error

2025-02-13T08:14:29.974Z	warn	[email protected]/exporter.go:340	validation errors	{"kind": "exporter", "data_type": "metrics", "name": "elasticsearch/otel", "error": "metric with name 'k8s.node.condition_ready' has already been serialized in document with timestamp 2025-02-13T08:14:29.902238381Z\nmetric with name 'k8s.node.condition_memory_pressure' has already been serialized in document with timestamp 2025-02-13T08:14:29.902238381Z\nmetric with name 'k8s.node.condition_ready' has already been serialized in document with timestamp 2025-02-13T08:14:29.902238381Z\n

Collector version

0.119.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

@carsonip carsonip added bug Something isn't working needs triage New item requiring triage labels Feb 13, 2025
@carsonip
Copy link
Contributor Author

/label -needs-triage

Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot removed the needs triage New item requiring triage label Feb 13, 2025
@carsonip carsonip changed the title [exporter/elasticsearch] Missing dimensions in grouping for metrics OTel mode [exporter/elasticsearch] data loss due to incorrect metrics grouping in OTel mode Feb 13, 2025
@carsonip carsonip changed the title [exporter/elasticsearch] data loss due to incorrect metrics grouping in OTel mode [exporter/elasticsearch] data loss due to incorrect metrics grouping Feb 13, 2025
andrzej-stencel pushed a commit that referenced this issue Feb 14, 2025
…ion (#37903)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Fix data loss when the same metric exists across different resources or
scopes. Data points / metrics were incorrectly grouped together due to
missing hash on resource / scope, leading to data loss with warning logs
e.g. "metric with name '***' has already been serialized".

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #37898

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/elasticsearch
Projects
None yet
1 participant