Room for improvement for log_sending=true

Kibana version: 8.7.0

Elasticsearch version: 8.7.0

APM Server version: 8.7.0

APM Agent language and version: 1.36.0

I just started using log_sending=true in the Java agent on one of our Q-Systems. The logs are transferred and stored in Elastic just fine. I can search the logs manually in Discover and everything, it is just that the logs are NOT shown in the APM UI.

This seems to be caused by the fact that we do not have microservices - we are running multiple applications in a single tomcat instance. Let's say I have an application called MyApplication running, I would expect the service.name of all logs to be set to MyApplication. In reality, the agent seems to instrument the logback appenders and has no reference to the original application (event.dataset is set to tomcat-application.MyApplicationAppenderDev, service.name is tomcat-application). This means, calling https://my-kibana-host:5601/s/my-team/app/apm/services/MyApplication/logs does not show the application logs.

I would prefer that the Elastic Agent would send the logs with the correct service name to make correlation easier.

Best regards
Wolfram

I haven't had time to reproduce this yet, but have you tried explicitly setting the service.name for the server?

have you tried explicitly setting the service.name

Maybe I am missing something, but what good would that do? When I explicitly set the service.name on the complete server - wouldn't that single service.name be used for all applications on this server instance? Currently, we are relying on the service.name autodetection of the agent for all applications on the tomcat (spring webapplications deployed as WAR-files).

Yes, you have it right, I misunderstood. I see you want the application log to be linked to the application transactions. As you note we don't have that correlation working yet. We'll discuss prioritising that

1 Like

Does it make sense to open a Feature request on Github or is there no need for that?

please do

Done: make log_sending=true correlate to the correct service · Issue #3123 · elastic/apm-agent-java · GitHub

Thanks, we're hoping to get to this next Q

1 Like

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