Skip to content

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

Closed
@carsonip

Description

@carsonip

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions