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

[exporter/elasticsearch] OTel mode @timestamp precision causes TSDB version conflict #35546

Closed
carsonip opened this issue Oct 2, 2024 · 2 comments · Fixed by #35548
Closed
Labels
bug Something isn't working exporter/elasticsearch

Comments

@carsonip
Copy link
Contributor

carsonip commented Oct 2, 2024

Component(s)

exporter/elasticsearch

What happened?

Description

When sending high traffic of metrics to Elasticsearch 8.16 using OTel mapping mode, it is possible to get error logs.

2024-09-18T15:14:23.115+0100	error	elasticsearchexporter@v0.109.0/bulkindexer.go:332	failed to index document	{"kind": "exporter", "data_type": "metrics", "name": "elasticsearch", "index": ".ds-metrics-generic.otel-default-2024.09.18-000001", "error.type": "version_conflict_engine_exception", "error.reason": "[nTN_4QYSjpM0biAuAAABkgV71wQ][QFI9z_AVWfXPjRal9mmHxBaEHFGlYZitCG-SF5Dv4af6d4idRLDI76NjRaBnhiIN2lxixVbyjo-FtJL-g-Mh1hs@2024-09-18T14:14:15.044Z]: version conflict, document already exists (current version [1])"}

It affects OTel mapping mode because the built-in otel-data plugin in ES will use TSDB and date @timestamp. In general, it affects cases where metrics is sent to TSDB where mapping @timestamp not of type date_nanos.

This is due to ES 8.16 grouping metrics in milliseconds as opposed to nanoseconds in elasticsearchexporter. This is a misalignment between ES and elasticsearchexporter, but the fix should go into ES.

Steps to Reproduce

In ES dev tools,

POST metrics-bar.otel-default/_doc
{"@timestamp":"2024-09-18T14:14:06.988158400Z","data_stream":{"dataset":"bar.otel","namespace":"default","type":"metrics"},"metrics":{"process.runtime.dotnet.jit.methods_compiled.count":17380},"resource":{"attributes":{"container.id":"b5028825d0c55c0811c3a6c9be8cc50db8d8d3975501778e28203288a9c5a6c7","docker.cli.cobra.command_path":"docker%20compose","host.name":"b5028825d0c5","service.name":"cartservice","telemetry.sdk.language":"dotnet","telemetry.sdk.name":"opentelemetry","telemetry.sdk.version":"1.9.0"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0,"name":"OpenTelemetry.Instrumentation.Runtime","version":"1.9.0"},"start_timestamp":"2024-09-18T11:02:07.006501300Z"}

POST metrics-bar.otel-default/_doc
{"@timestamp":"2024-09-18T14:14:06.988159300Z","data_stream":{"dataset":"bar.otel","namespace":"default","type":"metrics"},"metrics":{"process.runtime.dotnet.thread_pool.queue.length":0},"resource":{"attributes":{"container.id":"b5028825d0c55c0811c3a6c9be8cc50db8d8d3975501778e28203288a9c5a6c7","docker.cli.cobra.command_path":"docker%20compose","host.name":"b5028825d0c5","service.name":"cartservice","telemetry.sdk.language":"dotnet","telemetry.sdk.name":"opentelemetry","telemetry.sdk.version":"1.9.0"},"dropped_attributes_count":0},"scope":{"dropped_attributes_count":0,"name":"OpenTelemetry.Instrumentation.Runtime","version":"1.9.0"},"start_timestamp":"2024-09-18T11:02:07.006594400Z"}

Expected Result

No error

Actual Result

2nd metric not indexed

Collector version

v0.109.0

Environment information

Environment

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

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@carsonip carsonip added bug Something isn't working needs triage New item requiring triage labels Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Pinging code owners:

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

@carsonip
Copy link
Contributor Author

carsonip commented Oct 2, 2024

/label -needs-triage

@github-actions github-actions bot removed the needs triage New item requiring triage label Oct 2, 2024
andrzej-stencel pushed a commit that referenced this issue Oct 7, 2024
…lict_engine_exception error (#35548)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Add hint in error logs for TSDB version_conflict_engine_exception error

**Link to tracking Issue:** <Issue number if applicable>
Fixes #35546

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>
ghost pushed a commit to sematext/opentelemetry-collector-contrib that referenced this issue Oct 9, 2024
…lict_engine_exception error (open-telemetry#35548)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Add hint in error logs for TSDB version_conflict_engine_exception error

**Link to tracking Issue:** <Issue number if applicable>
Fixes open-telemetry#35546

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>
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