3

I am using elastic apm agent for monitoring, I have to download the apm-agent.jar and included it in my start entry point like java -javaagent:/path/to/apm-agent.jar app.jar.

The problem is I have to manually download the apm-agent.jar, is there a way that I can configure the apm agent in my Gradle dependencies? and then refer to the path of the jar file that was downloaded by gradle in the Dockerfile?

What is the proper way of dependency management for jar files like java agent?

Jakim
  • 1,713
  • 7
  • 20
  • 44

1 Answers1

0

Are you not building a custom Dockerfile and you could just add it there (using wget or curl probably)?

If you really want a build dependency, https://search.maven.org/artifact/co.elastic.apm/elastic-apm-agent/1.7.0/jar should be what you want.

PS: IMO it's a feature that this is only a runtime dependency and you can just add, remove, change it independently of your application; unless you want to do some custom instrumentation.

xeraa
  • 10,456
  • 3
  • 33
  • 66