Git Product home page Git Product logo

Comments (11)

eyalkoren avatar eyalkoren commented on September 17, 2024 1

@coolboi567 Unfortunately we do not automatically support Vert.x yet. So, answering your question- you will have to manage the transaction part manually. Regarding spans- it depends. Once you manage the transactions, spans would be created and reported automatically if you are using a supported framework, otherwise you will have to do that manually as well. Please have a look in our supported technologies page for details.

If you do decide to manually trace you app, you can use our public API, but please notice that you can't use the annotation API as they do not provide you with the flexibility for transaction creation/activation/deactivation/end you would need for Vert.x.

Another option is using our OpenTracing bridge.

I hope this helps. For any further questions, please use our discuss forum, where we will also love to hear if and how you decided to trace your application.

from apm-agent-java.

felixbarny avatar felixbarny commented on September 17, 2024

Some suggestions:

  • Did you maybe forget to specify the service_name?
  • Make sure to also declare a dependency to co.elastic.apm:apm-agent-java:$version
  • Which kind of application are you trying to trace? If you are not using any of the provided plugins, the implementation might not be initialized. You can work around this by calling ElasticApmTracer.get(); before calling ElasticApm.get();.

from apm-agent-java.

MarcoAbi avatar MarcoAbi commented on September 17, 2024

Thanks @felixbarny, I managed to do another step, however, I still have some issues:

  • ElasticApmTracer.get(); helped, indeed
  • my application is a microservice with Kafka stream processor / kafka producer. I'm willing to monitor the entire topology performance
  • I'm using also Vertx as framework

The problem I'm facing now is this message:

Trying to end a transaction which is not the current (thread local) transaction!

While it is true (with Vertx framework) that ElasticApm.get() has been instantiated on a diferent thread than elasticApm.startTransaction().
It is NOT true that elasticApm.startTransaction() and apmTransaction.end(); apmTransaction.close(); are on DIFFERENT threads.

I've tried also to remove Vertx framework and run everything on the main thread (just doing some tests) however, the warning message still pops up.

This is what I did so far (everything happens on the same main-thread):

ElasticApmTracer.get();
elasticApm = ElasticApm.get();

//...
// bootstrapping other stuff (such as kafka stream)
//...

Transaction apmTransaction = elasticApm.startTransaction();

//...
//doing my work I want to monitor
//...

apmTransaction.end();
apmTransaction.close();

// here prints the warning: Trying to end a transaction which is not the current (thread local) transaction!

Same thing happens if I start/end a span into the transaction (Trying to end a span which is not the current (thread local) span!)

I think I'm missing some basics of your architecture you have developed. Do you have some clue why this is happening?

Really thanks a lot for your help!!

BTW, if I can help somehow in the development of the library I'll be happy to collaborate.

from apm-agent-java.

felixbarny avatar felixbarny commented on September 17, 2024

Hi @MarcoAbi, you have to either call end() or close(), it is illegal to call both.

FYI: At the moment, it is only possible to start a transaction and attach it to the thread local storage. Starting a detached transaction is currently not possible, although I'm currently working on it. That is probably going to be important for the vert.x integration.

Contributions are always very welcome! Kafka and vert.x integrations are not on the roadmap for 1.x but we are definitely interested in it. If you'd like to contribute those it would be a great help! If you plan to do this deep integrations, I'd recommend using the internal API which is exposed via ElasticApmTracer. Note there are no backwards compatibility guarantees when using this API. But when you contribute the integrations, we can take care of the maintenance and refactoring, should the internal API change.

from apm-agent-java.

MarcoAbi avatar MarcoAbi commented on September 17, 2024

Thanks @felixbarny. The issue can be closed. With your help I could manage to send data to apm server. Now, however, the server replies with an error (http:400 - Problem validating json doc, missing properties "method"). I'll post another issue with details.

Thanks
Marco

from apm-agent-java.

felixbarny avatar felixbarny commented on September 17, 2024

Hi Marco,

could you please post that question in the discuss forum then? We use GitHub issues only for confirmed bugs and feature requests.

from apm-agent-java.

amexboy avatar amexboy commented on September 17, 2024

@fatmcgav Do I need to add the the apm-agent-api too? or is the apm-agent-java enough?

from apm-agent-java.

felixbarny avatar felixbarny commented on September 17, 2024

You don't need apm-agent-java, just apm-agent-api. See https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html. Note that you still have to add the -javaagent (see https://www.elastic.co/guide/en/apm/agent/java/current/intro.html), otherwise all operations will be noops.

from apm-agent-java.

prashant-shahi avatar prashant-shahi commented on September 17, 2024

Do we have to manually set up transactions and spans while using the APM Java Agent for Eclipse Vert.x?
Doesn't it automatically wrap around HTTP calls and DB calls like APM Node Agent for express?

from apm-agent-java.

amexboy avatar amexboy commented on September 17, 2024

@coolboi567 I'm only getting started and I didn't even succeed, but I don't think you need to set it up manually unless you need to do you own processing with the result

from apm-agent-java.

prashant-shahi avatar prashant-shahi commented on September 17, 2024

@amexboy I thought the same, but the java agent is not automatically doing the same.

@felixbarny Hey Felix, your response on the same would really be helpful.

from apm-agent-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.