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

Improve debugging experience #448

Open
NiccoMlt opened this issue Nov 9, 2023 · 0 comments
Open

Improve debugging experience #448

NiccoMlt opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@NiccoMlt
Copy link
Contributor

NiccoMlt commented Nov 9, 2023

We should add io.projectreactor:reactor-tools to improve debugging experience on modern IDEs like Intellij IDEA.

Project Reactor comes with a separate Java Agent that instruments the code and adds debugging info without paying a cost for capturing the stacktrace on every operator call like it happens with tracebacks in Debug mode and thus without the runtime performance overhead; see https://projectreactor.io/docs/core/release/reference/#reactor-tools-debug.

This could be very useful in some situations.

From documentation, there seem to be three possible ways to attach the instrumentation code.

Attaching it directly

  • add the dependency
    <dependency>
      <groupId>io.projectreactor</groupId>
      <artifactId>reactor-tools</artifactId>
    </dependency>
  • Initialize it in org.carapaceproxy.launcher.ServerMain (and maybe also in org.carapaceproxy.launcher.ZooKeeperMainWrapper)
    ReactorDebugAgent.init();

Running ReactorDebugAgent as a Java Agent

We could add -javaagent reactor-tools.jar to the VM options, by adding it to the JAVA_OPTS environment variable in setenv.sh file.

Running ReactorDebugAgent at build time

We could add it with the Byte Buddy Maven Plugin:

<dependencies>
  <dependency>
    <groupId>io.projectreactor</groupId>
    <artifactId>reactor-tools</artifactId>
    <classifier>original</classifier> 
    <scope>runtime</scope>
  </dependency>
</dependencies>

<build>
  <plugins>
    <plugin>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy-maven-plugin</artifactId>
      <configuration>
        <transformations>
          <transformation>
            <plugin>reactor.tools.agent.ReactorDebugByteBuddyPlugin</plugin>
          </transformation>
        </transformations>
      </configuration>
    </plugin>
  </plugins>
</build>
@hamadodene hamadodene added the enhancement New feature or request label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants