Description
APM Server version (apm-server version
): >= 8.15.5
Description of the problem including expected versus actual behavior: In #13196 we fixed a long-standing bug in APM server where it didn't support the infrastructure UI in Kibana for OpenTelemetry collector running with the hostmetrics receiver. The feature, as expected, is still live however the processes tab for the discovered hosts is now blank (with no data).
This is due to disabling date detection on APM mappings done via elastic/elasticsearch#116995 and released to 8.15.5
and 8.16.0
(to be fair, 8.16.0 already had the date detection disabled due to update in the base mappings done via https://github.com/elastic/elasticsearch/pull/111091/files PR). Without date_detection enabled, the field system.cpu.process.start_time
which is added as an enrichment via the opentelemetry-lib is not indexed as a field. The Kibana UI expects this field to be indexed as a date and uses its string representation to parse the date back to a date object (ref). A temporary fix for this could be to have a date mapping explicitly set for metrics custom component template:
PUT _component_template/metrics-apm.app@custom
{
"template": {
"mappings": {
"properties": {
"system.process.cpu.start_time": {
"type": "date"
}
}
}
}
}
In addition to this, there is another issue that prevents the hostmetrics UI to be populated. https://github.com/elastic/kibana/pull/209076/files PR changed the command line attribute used in the processes tab from system.process.cmdline
to process.command_line
, however (as I painfully discovered during a previous debug session), this would break the UI as there will be docs where process.command_line
attribute is present but attributes like user.name
, process.pid
, etc are not present causing the aggregation for the processes list to be broken. IIANM, this issue should also happen with the OTel native ingestion path involving hostmetrics.
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including server configuration, agent(s) used, etc. The easier you make it
for us to reproduce it, the more likely that somebody will take the time to
look at it.
- Create a deployment with 8.16.0++ version of the stack
- Run the opentelemetry collector with hostmetrice receiver configured (attached an OTel config file below).
- Open Infrastructure/Hosts UI, select a host, and open the Processes tab for the host. Expectation is that this should be populated.
Provide logs (if relevant): N/A