elastic / apm-agent-php

Apache License 2.0
252 stars 69 forks source link

`host.name` assigned with `pod.name` #1197

Closed crespocarlos closed 1 month ago

crespocarlos commented 1 month ago

Describe the bug

When viewing the Hosts UI with PHP APM service active in a k8s pod, PHP agent monitored services report the pod name in the host.name, which makes the Hosts View display hosts that do not correlate with hosts monitored by the system integration.

Steps to reproduce

edge-oblt can be used for the above.

Expected behavior

Only hosts (VMs) are expected to be present in the Hosts View.

Additional context

image image image

Sample doc

{
  "_index": ".ds-metrics-apm.internal-default-2024.07.17-000005",
  "_id": "6vcpxZABj_l6zbVSAgIC",
  "_score": 0,
  "_source": {
    "agent": {
      "name": "php",
      "version": "1.8.4"
    },
    "data_stream": {
      "dataset": "apm.internal",
      "namespace": "default",
      "type": "metrics"
    },
    "host": {
      "hostname": "opbeans-php-67455c896f-qszmc",
      "ip": "34.123.207.37",
      "name": "opbeans-php-67455c896f-qszmc"
    },
    "metricset": {
      "name": "span_breakdown"
    }
  }
}
crespocarlos commented 1 month ago

I had a quick call with @Mpdreamz , and he explained that the non-matching host names shipped by APM agents are due to missing configuration as exemplified in this comment https://github.com/elastic/observability-dev/issues/3321#issuecomment-2236909682.