@andrzej-stencel found out that this leads to issues when the system integration is installed.
The error message is:
2024-06-20T16:41:59.387+0200 error elasticsearchexporter@v0.102.0/elasticsearch_bulk.go:309 Drop docs: failed to index: struct { Type string "json:\"type\""; Reason string "json:\"reason\"" }{Type:"document_parsing_exception", Reason:"[1:370] failed to parse field [event.module] of type [constant_keyword] in a time series document at [2024-06-20T14:41:58.265Z]"} {"kind": "exporter", "data_type": "metrics", "name": "elasticsearch", "status": 400}
One of the metrics he was trying to ingest looks like this:
We'll need to find another field to taint the translated metrics, which isn't mapped as constant_keyword. From my perspective, we don't need to use a pre-existing ECS field for that (that could reduce the risk of similar clashes in the future), and a simple boolean may be enough.
In https://github.com/elastic/opentelemetry-lib/pull/18, we've added a way to differentiate translated metrics by setting
event.module
toelastic/opentelemetry-lib
:https://github.com/elastic/opentelemetry-lib/blob/c8fcaba71b9d57d21d8c0926ae100e422693429e/remappers/internal/metric.go#L71
@andrzej-stencel found out that this leads to issues when the system integration is installed.
The error message is:
One of the metrics he was trying to ingest looks like this:
The reason this fails is that the system integration adds a
constant_keyword
mapping for theevent.module
field withsystem
as a static value:https://github.com/elastic/integrations/blob/119664bbf8fb93d8279374f34d1faf7e960777e2/packages/system/data_stream/cpu/fields/base-fields.yml#L9-L12
We'll need to find another field to taint the translated metrics, which isn't mapped as
constant_keyword
. From my perspective, we don't need to use a pre-existing ECS field for that (that could reduce the risk of similar clashes in the future), and a simple boolean may be enough.cc @ishleenk17 @lahsivjar