-
Notifications
You must be signed in to change notification settings - Fork 770
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
Add library instrumentation for elasticsearch rest client 7 #8911
Conversation
} | ||
|
||
private static Function<RestClient, RestClient> getProxyFactory(Class<?> clazz) { | ||
for (Constructor<?> constructor : clazz.getDeclaredConstructors()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we expect that the class has a constructor that takes Header[]
as second and List
as third argument, these are the only 2 parameters that we need to fill with non default values. Alternatively we could skip the constructor call if there are too many changes in the constructors.
cc Elastic folks for visibility @AlexanderWert @estolfo @jackshirazi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I compared the instrumentation to what we do in the elastic-apm agent and to the Otel agent, it should be equivalent.
...rc/main/java/io/opentelemetry/instrumentation/elasticsearch/rest/v7_0/RestClientWrapper.java
Show resolved
Hide resolved
aa25ef4
to
7b35d89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
586e8d8
to
256cfef
Compare
Implement library instrumentation for
elasticsearch-rest-7.0
by using a byte-buddy bytcode proxy to wrap theRestClient
. Using bytecode proxy allows to handle differences in the constructor signature ofRestClient
so we don't need to have separate instrumentation for each change in the constructor.See #8867