Doing my best to create some custom code to use as a tracer and add into APM. It is the intention to create a transaction and append from different locations spans to it using context. Have started APM/Elastic/kibana stack on my local machine to debug. This does not result in anything. Would have hoped some failure or error, nothing is getting cought on APM/nor on Kibana or Elastic side.
Have tried all different combinations of environment variables. The code is about as simple as anything can be. If this does not work APM-agent does not work. Which other locations can you suggest for looking into potential issues. Would love something like a segmentation fault, or an entry in an error log, like this I am at a loss.
The thing is that even when you are using the API, you need to attach the javaagent. Otherwise nothing will happen the API does not include an implementation. The impel will be injected into the API only if the javaagent is added.
Have managed to define the javaagent as "VM arguments" inside eclipse. Don't understand what the other environment variables are for, mentioned in the documentation.
Nevertheless I get a different error now:
2018-12-17 13:58:55.530 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 1.1.0 as TestAPM on Java 1.8.0_181 (Oracle Corporation) Windows 7 6.1
Error: Could not find or load main class \
Don't think Eclipse is the problem.
Now I make it through to the apm-agent call,
but it fails to find the APM-server.
It is running fine,
in apm-server.yml:
Defines the host and port the server is listening on. use "unix:/path/to.sock" to listen on a unix domain socket.
host: "localhost:8200"
When in Cygwin I run this:
netstat -na | grep 8200
TCP 127.0.0.1:8200 0.0.0.0:0 LISTENING
Which is what I expect.
But still getting stuck:
2018-12-17 16:25:47.297 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 1.1.0 as TestAPM on Java 1.8.0_181 (Oracle Corporation) Windows 7 6.1
Error: Could not find or load main class \
Have removed these settings on the Kibana side, one of the posts suggested that: #apm_oss.errorIndices: apm-* #apm_oss.spanIndices: apm-* #apm_oss.transactionIndices: apm-* #apm_oss.onboardingIndices: apm-*
Now Eclipse is back to
2018-12-17 16:33:38.568 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 1.1.0 as TestAPM on Java 1.8.0_181 (Oracle Corporation) Windows 7 6.1
Error: Could not find or load main class \
The Kibana side mentions in a repeatable way:
December 17th 2018, 16:33:21.398
listening:127.0.0.1:8200 @timestamp:December 17th 2018, 16:33:21.398 host.name:XXXYYYZZZ beat.hostname:XXXYYYZZZ beat.name:XXXYYYZZZ beat.version:6.5.1 processor.name:onboarding processor.event:onboarding _id:MbzMvGcB2hbqiKRM4C3f _type:doc _index:apm-6.5.1-onboarding-2018.12.17 _score: - view errors: - error id icon: -
Definately not Eclipse,
Kibana and APM just don't work together,
how can I fix that
Which TAB on the Eclipse config are you looking for.
In fact I managed to get the below JSON visible on the kibana side,
but I still get the class not found error on eclipse:
2018-12-18 09:42:56.206 [apm-server-healthcheck] WARN co.elastic.apm.report.ApmServerHealthChecker - Elastic APM server is not available (Unexpected end of file from server)
2018-12-18 09:42:57.073 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 1.1.0 as TestAPM on Java 1.8.0_181 (Oracle Corporation) Windows 7 6.1
Error: Could not find or load main class \
The first error "Elastic APM server is not available" is not true, it is listing on the correct port, towards which my program is sending data. Even the data is arriving at Kibana.
The VM arguments on eclipse are below:
-javaagent:H:\elastic-apm-agent-1.1.0.jar
-Delastic.apm.service_name=TestAPM
-Delastic.apm.server_url=http://XXXYYYZZZ:8200
-Delastic.apm.application_packages=org.db
-Delastic.apm.log_level=INFO
When I configure like this:
-javaagent:H:\elastic-apm-agent-1.1.0.jar
-Delastic.apm.service_name=TestAPM
-Delastic.apm.server_url=http://localhost:8200
-Delastic.apm.application_packages=org.db
-Delastic.apm.log_level=INFO
Instead of hostname, I get a different error,
but still the same final result
2018-12-18 09:48:43.562 [main] INFO co.elastic.apm.configuration.StartupInfo - Starting Elastic APM 1.1.0 as TestAPM on Java 1.8.0_181 (Oracle Corporation) Windows 7 6.1
2018-12-18 09:48:43.641 [apm-server-healthcheck] INFO co.elastic.apm.report.ApmServerHealthChecker - Elastic APM server is available: {"ok":{"build_date":"2018-11-16T01:21:45Z","build_sha":"e9b22404feb418663d86f059b833bf1487d9379e","version":"6.5.1"}}
Error: Could not find or load main class \
Thanks for your reply felixbarny, but will this work only with web projects in java?, I'm querying from DB but it still does not show up anything, but if used in a web project I can see the metrics. If there is a sample for standalone java project(not web based) it would be grateful. Thanks a lot
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.