-
Notifications
You must be signed in to change notification settings - Fork 917
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 metric annotation instrumentation #11354
base: main
Are you sure you want to change the base?
add metric annotation instrumentation #11354
Conversation
There are some CI failures, firstly you can solve them by referring to https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/running-tests.md#troubleshooting-ci-test-failures |
f1797c8
to
f7dd6b9
Compare
...entation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/Counted.java
Outdated
Show resolved
Hide resolved
Hi @steverao, I found that there are lots of fails "to connect to localhost/127.0.0.1:4318". So I want to rerun the task, but I can't see the rerun button. Is it disabled for contributors? |
Yes, you can fix the problems firstly and push relevant commits. It will trigger to rerun the CI tasks. |
I mean I guest the failure is caused by the CI run time environment crush..... if it's able to rerun a task, It might save some time.... |
815bbfd
to
95f0f0d
Compare
f9657ec
to
5ab650b
Compare
I turn it ready for reviewing, and get some questions for discuss:
|
5024350
to
54866bf
Compare
54866bf
to
21cbf96
Compare
27df0c9
to
7c1b5f0
Compare
7c1b5f0
to
bb4cb98
Compare
import javax.annotation.Nullable; | ||
|
||
/** Callback that is called when async computation completes. */ | ||
public interface AsyncOperationEndHandler<REQUEST, RESPONSE> { |
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.
I get the name, but I think it's too specific and long.
What else can it handle apart from ending a span?
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.
I think it needs to handle the end of the timer and record the duration to the histogram metrics recorder.
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.
This is effectively an Instrumentation Callback... Why not call it that?
Something like InstrumenterCallback
with an end()
method...
I can imagine this also being useful to add attributes if later we add an addAttribute()
method.
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.
Hi @brunobat, I go through the code. The class Instrumentation
is coupled with the implementation of the span's operations(here) and it's widely used. It's going far from the guide's suggestion(here). I think to create a new set of abstract operation for metrics instrumentation and update the guide would be an option. @laurit gave a good example of it. And what's your opinion about it...
refer to #7030
add metric annotation instrumentation