554 questions
0
votes
0
answers
26
views
intellij-idea: Possible to reconnect to a .run.xml javaagent after intellij had been restarted
I have a java program started from a .run.xml intellij config, intellij died but process kept running and working fine. Is it possible for me to reconnect/attach to it so I can see the stderr and ...
0
votes
0
answers
26
views
How to execute the "mvn exec:java" command and indicating a javaagent?
For a Java application with Maven the following command works
mvn exec:java \
-Dexec.mainClass="com.manuel.jordan.main.Main" \
-Dexec.cleanupDaemonThreads=false
Observation: in the ...
1
vote
1
answer
186
views
Otel Extension with External Libraries
What am I doing ?
trying to create a Otel Extension and everything is working fine until the moment I use external libraries.
Relevant context information:
I am using Maven instead of Gradle.
I don'...
0
votes
2
answers
70
views
How properly ThreadLocal Context in the ByteBuddy Instrumentation Advice
Hi I'm trying to build a trace agent where app agent propagates the origin application name across the multiple network calls using the HTTPUrlConnection.
So far, I was able to invoke the Advice ...
0
votes
1
answer
56
views
TCP socket communication between parent and child process blocks after a few seconds (a few hundred bytes)
For test automation, my program starts the installer (= child process):
Runtime.getRuntime().exec(new String[] { "installer.exe", "-J-javaagent:myagent.jar" });
The installer ...
0
votes
1
answer
214
views
java agent throws UnsupportedClassVersionError when Instrumentation#retransformClasses is called
I'm trying to make a java agent to dump the caller of a method. I am using objectweb's ASM to transform the target method to invoke a function which dumps the caller and the internal state of the ...
1
vote
0
answers
121
views
Add caller information with Opentelemetry java agent instrumentation
I have test java app with java agent opentelemetry instrumentation: -javaagent:/usr/src/app/opentelemetry-javaagent.jar -Dotel.instrumentation.log4j-context-data.enabled=true -Dotel.instrumentation....
0
votes
1
answer
47
views
how to record java execute path? [duplicate]
I want to know my customer how to use my application. for example, i have a spring-web applicaiton. customer call the service 100 times.
i want to analyst every time service's execute path.
eg.
1 time ...
1
vote
1
answer
56
views
How to use matchers for the argument of canThrow() with ByteBuddy?
I'm writing some code where I would like to instrument every method in a class that throws a specific exception, so I would like to have something like this:
builder.method(ElementMatchers.canThrow(...
-1
votes
1
answer
67
views
OpenTelemetry Java Agent extension not loaded
I have created a simple, dummy OpenTelemetry Java Agent extension. It contains only one class and it looks like this:
import com.google.auto.service.AutoService;
import io.opentelemetry.sdk....
0
votes
1
answer
430
views
JVM cannot find Agent_OnLoad in agent lib
I am coding a Java Agent library. However, the JVM cannot find Agent_OnLoad function even if I have explicitly exported it in my C++ code.
JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM* vm, char* ...
1
vote
1
answer
117
views
How to use Java agent intercept to instrument java.net.Socket with javaassist
I am working on a project where I need to write some header to the socket output stream right after the socket is connected.
I want to intercept at low level such as java.net.Socket and its connect ...
2
votes
1
answer
265
views
Can apm-agent-java plugin be placed inside the application JAR file?
Motivation
Elastic APM Java agent does not support R2DBC. They provide a plugin API, which
lets you add custom instrumentation to the agent, which the agent will automatically apply the same way as ...
1
vote
1
answer
569
views
Starting a Spring boot project with a custom Java agent jar gives errors
As shown in the following figure, a custom Java agent package is added to the JVM options
-javaagent:/usr/local/maven/apache-maven-3.6.3/repository/com/graviton/Probe-Agent/1.0-SNAPSHOT/Probe-Agent-1....
0
votes
2
answers
230
views
is this the right way to add annotation with bytebuddy in java agent?
I want to add an annotation to all methods of some classes in a java agent, I did this and it worked , but I'm not sure if that's the right way because i saw other examples that i didn't understand.
I ...
0
votes
1
answer
107
views
Intercepting OutOfMemoryErrors with JVM agent
I am trying to write an agent with ByteBuddy that would intercept the construction of java.lang.OutOfMemoryError and call my static method on that occasion. The target intention is to propagate ...
0
votes
1
answer
122
views
Why does java agent get stuck and not perform any actions?
I am writing a term paper for the university. The task is to write two programs, one of which collects some information, signs it with a digital key, and saves the encrypted data and the key to ...
0
votes
0
answers
126
views
JNI Error when instrumenting with OpenTelemetry
I am running this code:
java -javaagent:/path/to/opentelemetry-javaagent.jar -jar /path/to/my/project/out/artifacts/project_jar/project.jar
While meaning to instrument the code in my project and ...
0
votes
0
answers
333
views
With Java 17, JUnit5, is there a way to always launch a test with a Java Agent?
We need to make sure we always launch several Java JUnit5 tests with EclipseLink as a Java Agent. This is because these test will do some JPA dynamic queries and EclipseLink needs to do some class ...
1
vote
0
answers
92
views
(Instrument API, Agent)My ClassFileTransformer's transform method fails to recognize a specific class in Springboot
Background:
Hello, I am developing an Agent through bytecode manipulation. Using the Instrument API, I aimed to read all classes before class loading by utilizing premain - ClassFileTransformer. My ...
0
votes
1
answer
432
views
Not able to intercept methods of java.net.HttpURLConnection class in Java 17
i want to intercept the connect() method of java.net.HttpURLConnection. for that i am using below provided code. The provided code intercepts the connect method of the HttpURLConnection class in Java ...
3
votes
2
answers
4k
views
How to use extensions in OpenTelemetry java for auto-instrumentation
I have created a my custom extension with below custom spanProcessor with customizerProvider. I am providing my custom span processor in my tracerProvider.
I am running my extensions and java-agent ...
0
votes
1
answer
207
views
How to Package a Java Agent into the Host Project?
Hellooooo, I am new to Stack Overflow,I'm clumsy when it comes to asking questions.
But I will provide additional information if the question is unclear.
This is the issue I encountered, as follows:
...
1
vote
1
answer
499
views
Why do I can not start Kafka as a Java agent
I have problem with JMX when start Kafka as Java agent with this compose file:
broker:
image: confluentinc/cp-kafka:7.5.0
hostname: broker
container_name: broker
ports:
- "...
2
votes
1
answer
754
views
Error message mentions Java 9 even though I am using Java 11
I have a Java 11 Gradle project for work. I am using IntelliJ Idea. I have some test errors, so I'm trying to debug. The error message I'm asking about appears to be unrelated to the test errors, but ...
0
votes
0
answers
460
views
"Agent JAR not found or no Agent-Class attribute",but success when invoke quickly after the java process start
Here is the position,when i use java agent to attach a running java project,it failed.It reported "Agent JAR not found or no Agent-Class attribute".
I know this is not the reason of my agent ...
2
votes
0
answers
2k
views
Can the JVM automatically load an agent without specifying agentpath on the command line?
I have a java application packaged in a jar that I am trying to run on a Windows 10 workstation. I am running the application using the command line:
C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-...
0
votes
0
answers
302
views
Java Agent Class Loader
I have a problem with how to instruct class loader to use Java Agent jar as a reference for classes.
I am using VirtualMachine to attach to specified process with Java Agent, and with most of
the ...
0
votes
1
answer
2k
views
opentelemetry-javaagent.jar issue with spring boot application
In my spring boot application using Jaeger UI to track the logs.We are using 'bootbuildimage' plugin to build and push the image. due to this not using 'Docker' file and only using 'docker-compose.yml'...
0
votes
0
answers
836
views
OpenTelemetry Java Agent Not Receiving Arguments from SBT Build
I'm currently facing an issue with the OpenTelemetry Java Agent not receiving the arguments I pass to it in my SBT build file. Here's a snippet from my build file:
val buildOpenTelemtryJavaAgent: ...
1
vote
0
answers
109
views
2 java agents conflicting with each other
I want to instrument getMessage() method of Throwable class and output some custom message to System.out or logger. I have written an agent called FirstAgent that is working fine as expected. Now my ...
-2
votes
1
answer
971
views
How to redefine a class with Byte-buddy to add an additional method
If I have the following Class named Dog
public class Dog {
private String name = "Spike";
private int age = 3;
public Dog() {}
public String getName() {
return name;
}
...
1
vote
0
answers
304
views
javassist.NotFoundException occurred while Javassist was processing classes generated by Cglib
My code is below:
pom.xml
<dependencies>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
...
0
votes
0
answers
488
views
java.lang.NoClassDefFoundError when my Java instrumentation agent class tries to instantiate ClassFileTransformer
I went through a baledung article on Java instrumentation api and trying to run the code from the article on my machine.
I'm basically trying to do a static load. My agent code is unable to ...
0
votes
1
answer
41
views
get Javassist MethodInfo from Apache BCEL JavaClass
I recently wanted to make this github projectWhyline to use library instead of writing own code. This project has a javaagent and I am stucked in the whyline/tracing/ClassInstrumener.java class. So I ...
0
votes
1
answer
3k
views
When using OpenTelemetry Java agent to capture traces, all critical metrics degrade close to 15%
We are evaluating open telemetry Java agent to capture traces. I have done a perf test using Jmeter and noticed all critical metrics (Latency, requests/sec, heap memory), though CPU remain almost ...
2
votes
1
answer
4k
views
Enable/disable programmatically opentelemetry exporters
I would like to have the ability to enable exporters only when needed for troubleshooting. Disabling the agent wouldn't make sense, since the instrumentation should happen when starting the jvm, so my ...
1
vote
0
answers
174
views
will ThreadMXBean operations cause JVM STW and does it make sense peroidly invoke findDeadlockedThreads?
I am wondering if I invoke findDeadlockedThreads periodly inside JVM, there are performance issues at pos <1> or <2> below because of JVM STW(Stop of The World)?
ThreadMXBean bean = ...
1
vote
3
answers
345
views
Can't use static variable in @Advice.OnMethodEnter method in opentelemetry javaagent extension
I'm trying to create an extension for opentelemetry javaagent. I need some static variables outside the methods to handle spans. But I get the error java.lang.ClassNotFoundException for a class where ...
9
votes
2
answers
2k
views
How to use Java agent with native compiled spring boot application
Together with our SpringBoot (3.0.3) application we are using Application Insights (Azure) for monitoring.
Currently we are trying to compile the application natively with the GraalVM. That works ...
1
vote
2
answers
67
views
Error: can not find or load main class com.briar.Agent
My project structure is as follows:
---Detail-RASP---src
My maven pom file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0&...
0
votes
3
answers
10k
views
NoClassDefFoundError when trying to use opentelemetry Instrumenter in javaagent extension
I want to implement extension to manage methods tracing. I've implemented TypeInstrumentation class to around and utilite class for instrumenter() as described opentelemetry instrumentation module:
...
0
votes
1
answer
1k
views
Maven example to add extended agent
I m writing my own extension with maven and I wanted to embed the extension and create a single jar. I saw an example in https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/...
0
votes
1
answer
1k
views
OpenTelemetry Java agent extension to add Spring authenticated User id in Span attributes
I have a Spring Boot 2.7.5 application running with an opentelemetry-javaagent.jar that includes some custom extensions. I now want to add a custom SpanProcessor that adds an attribute userId to all ...
0
votes
1
answer
395
views
Akka http request does not trace through opentelemetry
I am trying to use opentelemtry (OTEL) in akka-http application (Scala), using the stand alone agent.
In my sbt I have this:
fork := true
run / javaOptions ++= Seq(
"-XX:+UseG1GC",
&...
0
votes
0
answers
114
views
Why would retransformClasses fail silently?
I'm trying to retransform classes with java instrumentation. The code below runs just fine, it prints Hello World!!.
public class Main {
public static void main(String[] args) throws Throwable {
...
0
votes
1
answer
303
views
attach failed with error: java.io.IOException: Premature EOF
while I try to attach a process with code like:
vm = VirtualMachine.attach(pid);
vm.loadAgent(attachJarPath, properties);
I got this error:
java.io.IOException: Premature EOF
at sun.tools.attach....
0
votes
1
answer
174
views
How can I check that my application is shutdown with QFTest?
I check a Java application with QFTest. I need to prove that the HMI is stopped at Shutdown.
In QFTest, I created a Jython procédure which try to send a socket to the HMI, if it can't, then it means ...
1
vote
0
answers
198
views
ClassNotFoundException while calling a class in main application from java agent extension
I am running a spring boot application, which has a dependency in pom.xml (i.e., client-library)
A java agent extension is running parallelly with spring boot application. I am trying to call a class ...
1
vote
1
answer
846
views
Trying to implement interface and override java.lang.String with Byte Buddy
I tried with this example especially designed for
ignored by byte-buddy.
I solved errors, and it looks like working with this code.
new AgentBuilder.Default()
.with(new AgentBuilder....