How does apm-server set service.name?

I have deployed apm-server on multiple public cloud kubernetes clusters, but when they send health metrics to elasticsearch, the service.name is all called apm-server , is there any way to distinguish it? I checked the apm-server documentation and found no instructions on how to set the service.name, only a "name" can be used, but in fact it only generates a Beat name, and does not change the service.name.

{"log.level":"info","@timestamp":"2022-02-08T07:37:25.618Z","log.logger":"publisher","log.origin":{"file.name":"pipeline/module.go","file.line":113},"message":"Beat name: lonsid-aks","service.name":"apm-server","ecs.version":"1.6.0"}

How are you sending the logs to Elasticsearch? Are you using Filebeat? If so, can you use one of its processors to enrich the logs, e.g. by adding the host name?

service.name is meant to be the same for all nodes of a service, so it is expected that it's always just "apm-server". In theory we could set service.node.name in the logs, but you would need to configure this manually. There's currently no way to do this in apm-server.yml, so you would need to add it through Filebeat or similar.


Thank you for your reply, I noticed after posting that "Stack Monitoring" shows the beat name, so the problem is solved.
I will refer to your suggestion to enrich the log meta collected by filebeat

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.