elastic / apm-agent-dotnet

https://www.elastic.co/guide/en/apm/agent/dotnet/current/index.html
Apache License 2.0
586 stars 208 forks source link

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

Closed crespocarlos closed 4 months ago

crespocarlos commented 4 months ago

Describe the bug

When viewing the Hosts UI with .NET APM service active in a k8s pod, .NET 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.06.19-000001",
  "_id": "z4aOVJABqw49vaJvv3PP",
  "_score": 0,
  "_source": {
    "agent": {
      "name": "dotnet",
      "version": "1.19.0+f72bf10e024b0bad4601ccda7fdea7db46c71640"
    },
    "cloud": {
      "availability_zone": "us-central1-c",
      "instance": {
        "id": "5715715594122280222",
        "name": "gke-edge-oblt-edge-oblt-pool-8fc2868f-7k5g"
      },
      "machine": {
        "type": "e2-highcpu-4"
      },
      "project": {
        "id": "8560181848",
        "name": "elastic-observability"
      },
      "provider": "gcp",
      "region": "us-central1"
    },
    "data_stream": {
      "dataset": "apm.internal",
      "namespace": "default",
      "type": "metrics"
    },
    "host": {
      "hostname": "opbeans-dotnet-64c6dc9795-m9j9t",
      "ip": "34.45.145.32",
      "name": "opbeans-dotnet-64c6dc9795-m9j9t"
    },
    "metricset": {
      "name": "span_breakdown"
    }
  }
}
crespocarlos commented 4 months 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.