Is there a concept similar to `application_packages` in `Elastic Distribution of OpenTelemetry Java`?

  • I would like to know if there is a concept similar to application_packages in Elastic Distribution of OpenTelemetry Java?
  • When I test the Spring Boot application locally through Elastic APM Java Agent, I have operations similar to the following:
sdk use java 22.0.2-graalce
./mvnw clean dependency:get -Dartifact=co.elastic.apm:elastic-apm-agent:1.51.0
./mvnw clean spring-boot:run \
  -Dspring-boot.run.agents="$HOME/.m2/repository/co/elastic/apm/elastic-apm-agent/1.51.0/elastic-apm-agent-1.51.0.jar" \
  -Dspring-boot.run.jvmArguments="\
  -Delastic.apm.service_name='smoke-tests' \
  -Delastic.apm.server_url='http://localhost:8200' \
  -Delastic.apm.application_packages='io.github.linghengqian.smoke.tests'\
  "
  • But it looks like GitHub - elastic/elastic-otel-java doesn't have an environment variable or system property like elastic.apm.application_packages? Is this expected behavior? This is how I tested the Elastic Distribution of OpenTelemetry Java:
sdk use java 22.0.2-graalce
./mvnw clean dependency:get -Dartifact=co.elastic.otel:elastic-otel-javaagent:1.0.0
./mvnw clean spring-boot:run \
  -Dspring-boot.run.agents="$HOME/.m2/repository/co/elastic/otel/elastic-otel-javaagent/1.0.0/elastic-otel-javaagent-1.0.0.jar" \
  -Dspring-boot.run.jvmArguments="\
  -Dotel.exporter.otlp.endpoint='http://localhost:8200' \
  -Dotel.resource.attributes='service.name=2-smoke-tests'\
  "
  • I don't think this requires any reproducible git, because at this point the Elastic Distribution of OpenTelemetry Java is instrumenting io.opentelemetry.apache-httpclient-5.0 .
  • In contrast, for the same Spring Boot application, the framework monitored by the Elastic APM Java Agent is Spring Web MVC.
  • Something like the elastic.apm.application_packages system property for the Elastic APM Java Agent does seem to work. But I can't find an equivalent for the Elastic Distribution of OpenTelemetry Java.

Hi @linghengqian

Perhaps this.

otel.javaagent.exclude-classes

I was just looking around, let us know if it works..

EDIT / UPDATE : As @Jack_Shirazi said below

@linghengqian When I saw this topic I thought you were trying to include / exclude packages

application_packages

Apologies for any confusion...

I think you are referring to the "Framework" description in the dropdown about the service from the Java icon. This gets set by the service.framework.name attribute which the agent generates from the instrumentation. The Elastic APM Java Agent has carefully assigned names for these values which are different and more readably descriptive than the name of the instrumentation (here spring-mvc) that generates the traces.

The Elastic Distribution of OpenTelemetry Java (EDOT Java) uses the logic of the upstream OpenTelemetry Java agent, which doesn't have equivalent readably descriptive naming for instrumentations, which means only the instrumentation name itself can be shown.

None of this is related to application_packages.

So for now, there is no mechanism to display a nicer descriptive name in the "Framework" when using the EDOT Java agent. I've opened an enhancement request for this

2 Likes

The Elastic APM Java Agent startup time can be improved a number of ways. The EDOT Java agent doesn't (yet) have as much flexibility. The referred to issue will not improve startup time, it will only improve display of traces in the trace waterfall diagram

1 Like