I am running a Java application inside a docker container, with the OpenTelemetry Java Agent, which is connected to my OpenTelemetry Collector running on the same machine, also in a docker container.
The metrics reported by the OpenTelemetry Collector are reported with the correct host.name. Since the collector also runs inside a docker container (on a VM on Azure), I managed to get it to use the right collector with this configuration (putting azure first).
processors: batch: send_batch_size: 1000 timeout: 10s # Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/README.md resourcedetection: detectors: [azure, env, system] # Before system detector, include ec2 for AWS, gcp for GCP and azure for Azure. # Using OTEL_RESOURCE_ATTRIBUTES envvar, env detector adds custom labels. timeout: 2s system: hostname_sources: [os] # alternatively, use [dns,os] for setting FQDN as host.name and os as fallback override: true However, the logs coming from the application itself are still being reported with the random hostname given by docker. I was hoping the override: true would do the trick, and replace it with the OTEL collector one, but I am still getting random hostnames that change with each application deployment, like 3b4186437d2f.
What is the proper way to override the host.name from the OTEL collector's processor, so that the application's host.name is ignored?