Span breakdown metrics and service name auto-discovery (Time spent by span type is empty)

Hi,

just wanted to confirm if this is expected behavior:

If I use the Elastic APM Agent in a servlet environment (e.g. JAX-RS running on a Wildfly) and don't set the service_name, then the span breakdown metrics won't be available (i.e. the "Time spent by span type" will be empty).

This is because apparently the span breakdown metrics will be computed not per display-name, but only once per application server (in my case, they all have service.name = jboss-application).

I know the documentation states:

When relying on auto-discovery of the service name in Servlet environments (including Spring Boot), there is currently a caveat related to metrics. The consequence is that the Metrics tab of a service does not show process-global metrics like CPU utilization.

However, this does not necessarily imply span breakdown metrics being unavailable. I would not assume them to be "process-global" metrics.

Any way to get the span breakdown metrics per display-name and not only per application server?

Thanks!

spans should be showing. Are you saying that if you set the service_name you see them, but if you leave it unset you don't?

Spans itself (as part of transactions) are showing. I am talking about the span breakdown metrics (which are visualized in the "Time spent by span type" visualization in Kibana APM):

image

Yes, if I set the service_name, the data is shown - if I don't set the service_name, the span breakdown metrics disappear because they are all being tagged with service.name = jboss-application and not with the auto-discovered context name.

per-service within application server metrics are being worked on eg this PR being worked on right now, I'm not sure if that includes the span breakdowns you're referring to, I'll need to delve a bit to see

1 Like

This has been fixed in this PR: Track metrics for each service individually (#2204) by tobiasstadler · Pull Request #2208 · elastic/apm-agent-java · GitHub.

However, it requires APM Server 8.0 which is not out yet.

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