Fresh install or upgraded from other version? fresh install
Hi
I am trying to use open tracing API in my application to trace events. Can Kibana visualize the events captured by the open API spans ? I was able to trace my application using the native elastic API , but I want to make it work with open tracing API.
I have used the ElasticApmTracer but when I try to use the below line
span = tracer.buildSpan(eventName).startActive(false).span();
I am able to get SpanBuilder , scope manager but I am not able to start the span as start method is an inner interface of the main Tracer inteface .
How can i start my span after using the elasticAPm bridge
There is an example also provided in the elastic website as below
In 1.9.0 we upgraded our OpenTracing support to version 0.33, where this API was removed (rather than being marked deprecated). Since you are using an older OpenTracing version, your compiler maps this method invocation to the Tracer.SpanBuilder#startActive interface method and the runtime fails to invoke the co.elastic.apm.opentracing.ApmSpanBuilder#startActive implementation.
There are several options:
Downgrade the Elastic Java agent OpenTracing bridge dependency to 1.8.0
Upgrade your OpenTracing dependency to 0.33 and avoid using invalid APIs. Since you are using the startActive APM with false, this shouldn't be big problem as you already finish spans manually. You will need to use the other activation APIs.
Cast the SpanBuilder returned from buildSpan to co.elastic.apm.opentracing.ApmSpanBuilder before invoking startActive
Thanks for the response . My open tracing api is version 0.33 I believe .
Also I cannot use Apmspanbuilder class in my code as the scope is default for that java class and it does not have access outside it’s own package correct ?
I used the below code to capture the open trace spans
Tracer tracer = new ElasticApmTracer();
Span span = tracer.buildSpan(eventName).start();
But Kibana is not getting any traces or events .
I have opentracing-api-0.33.0,opentracing-noop-0.33.0,opentracing-util-0.33.0,apm-opentracing-1.9.0 , apm-agent-api-1.9.0 in the class path.
Could you pls let me know why Kibana wouldnt get the events
Make sure you properly close all scopes and finish all spans. Usually, when there are no errors in the agent logs, these issues are related to improper management of the tracing objects.
You can also set log_level to DEBUG (or TRACE) and track internal transaction/span creation and lifecycle management.
Sorry I did not use elastic span and transaction . I will remove that . Not mixing them up. Where can we see the logs ? In kibanaUI? Or is it written in a folder .. thanks again
Using it through -javaagent is what I meant by "install"
OK, so you should see agent messages being logged alongside the application logs. If you see errors- please share. Otherwise, try to follow them and see whether there are activated transactions/spans not being deactivated (meaning- unclosed scopes) or spans/transactions not being ended (through OpenTracing finish).
Sure let me try to trace logs . Also I have not closed the span . I was thinking the open trace Api will automatically take care of it . Do we need to use “scope”as wel cos I just used a tracer and directly started the span . Thanks for all the inputs much appreciate that . I will keep you posted in a few hours about the logs .
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.