Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumenting Apache Camel #439

Closed
bourretp opened this issue Aug 1, 2018 · 1 comment
Closed

Instrumenting Apache Camel #439

bourretp opened this issue Aug 1, 2018 · 1 comment
Milestone

Comments

@bourretp
Copy link

bourretp commented Aug 1, 2018

Hi,

I try to instrument Apache Camel routers so I can

  • start a transaction when a message enters the route
  • stop the transaction when a message exits the route.

The problem is that routes are build using a DSL (http://camel.apache.org/java-dsl.html) and there is no specific class/method for the route being built, and I see no way to instrument that route using AOP.

Is there a way to completely bypass the AOP approach and to manually

  • start a new transaction at some point
  • stop at a later point (same thread! :)

Pseudo-code:

    from("file:src/data?noop=true")
        .process(() -> {/* Start transaction here ? */})
        // Content of the route here...
        // ...
        .process(() -> {/* Stop transaction here ? */})
    .to("file:target/messages/uk")
@trask trask closed this as completed in 8652c42 Feb 15, 2019
@trask trask added this to the v0.13.1 milestone Feb 15, 2019
@trask
Copy link
Member

trask commented Feb 15, 2019

Hi @bourretp, thanks for posting! My concern about having separate start/stop is that you have to be really sure that stop gets called, otherwise abandoned trace could cause memory leak. Instead, if they are being called by the same thread, I try to instrument the caller of both of the methods. I took a look at Apache Camel, and created a (starter) plugin that I think(?) accomplishes what you are looking for. This is available now in the latest snapshot release glowroot-agent-0.13.1-SNAPSHOT-dist.zip.

@trask trask changed the title Ability to manually start/stop transaction Instrumenting Apache Camel Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants