I don't have any experience with Play, but I'll try
I am not sure why you imported co.elastic.apm.attach.ElasticApmAttacher, which is used for remote attachment to the JVM. Please review the different available setup options.
Basically, the Java agent is either provided as the javaagent command line argument (e.g. using these Play options to specify JVM arguments), or remotely attached.
In any case, the agent itself needs to be installed. Note that the API jar (which contains the co.elastic.apm.api.ElasticApm you are using here) is acting as noop as long as the Java agent is not installed.
Actually the co.elastic.apm.attach.ElasticApmAttacher import it's not used (but thanks for reporting).
In the end the only way to make it work was to use cinnamon and connect it via opentracing to ElasticApm.
To do this, however, I had to start 2 agents (apm and cinnamon).
...and add a custom tracer factory like this:
import co.elastic.apm.opentracing.ElasticApmTracer;
import com.lightbend.cinnamon.opentracing.TracerFactory;
import io.opentracing.Tracer;
public class CustomTracerFactory implements TracerFactory {
@Override
public Tracer create() {
return new ElasticApmTracer();
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.