Comments (11)
@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.
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 callingElasticApm.get();
.
from apm-agent-java.
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.
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.
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.
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.
@fatmcgav Do I need to add the the apm-agent-api too? or is the apm-agent-java enough?
from apm-agent-java.
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.
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.
@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.
@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)
- Fix docker image publication version
- Send host.id received from profiler via IntakeV2 metadata
- Agent crashes when transaction_max_spans=1
- [Improve] Introduce Apache Pulsar client monitoring support HOT 3
- 1.50.0 agent fails to start on Java 7 HOT 3
- OTel SpanLink results in ClassCastException HOT 6
- Allow otel bridge span links to be added after span creation
- Elastic APM Java agent cannot automatically infer the class name / object name for a span when using Scala and @CaptureSpan HOT 3
- java.lang.NoClassDefFoundError: Could not initialize class sun.net.www.protocol.https.DelegateHttpsURLConnection HOT 14
- KafkaProducerHeadersInstrumentation logging error HOT 9
- Spring6-Scheduled-null HOT 1
- NOFOLLOW_LINKS causes issues on Z/OS HOT 4
- `host.name` assigned with `pod.name` HOT 1
- Add support for capturing HTTP Client request bodies
- Optimize the IndyBootstrap#getClassNamesFromBundledPlugin method to reduce memory usage caused by package scanning HOT 1
- [META 882] Check classic and OTel agents against serverless HOT 1
- log correlation is broken for at least one configuration HOT 1
- Dependency Dashboard
- Cannot invoke "java.net.InetSocketAddress.getAddress()" because "inetSocketAddress" is null HOT 5
- [META 888] Update AWS ECS Fargate container ID regex.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apm-agent-java.