open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.9k stars 2.27k forks source link

[exporter/elasticsearch] Double values encoded without decimal point causes wrong dynamic mapping #34680

Closed carsonip closed 1 week ago

carsonip commented 1 month ago

Component(s)

exporter/elasticsearch

What happened?

Description

In objmodel, a double value e.g. 1.0 is encoded as 1 in the resulting json, causes it to be dynamically mapped in Elasticsearch as a long instead of a double / float.

Steps to Reproduce

  1. Send 1.0 to Elasticsearch to a field with dynamic mapping
  2. Query it back
  3. Check resulting mapping

Expected Result

Getting 1.0 back, mapped as double.

Actual Result

Get 1 back, mapped as long

Collector version

v0.107.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

github-actions[bot] commented 1 month ago

Pinging code owners:

crobert-1 commented 1 month ago

Removing needs triage as this was filed by a code owner.