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

Add a ClassAndMethod class to Instrumentation API #4619

Merged
merged 4 commits into from
Nov 10, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 9, 2021

Resolves #4592

docs/contributing/writing-instrumentation.md Outdated Show resolved Hide resolved
@@ -384,3 +384,18 @@ dependencies {
testImplementation(project(":instrumentation:yarpc-1.0:javaagent"))
}
```

## Why we don't use ByteBuddy @Advice.Origin Method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +171 to +173
// Every usage of @Advice.Origin Method is replaced with a call to Class.getMethod, copy it
// to local variable so that there would be only one call to Class.getMethod.
method = originMethod;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting, great find

@@ -384,3 +384,18 @@ dependencies {
testImplementation(project(":instrumentation:yarpc-1.0:javaagent"))
}
```

## Why we don't use ByteBuddy @Advice.Origin Method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about moving it to the writing-instrumentation-module file, just below the Associate instrumentation classes with instrumented library classes section? It seems like it'd fit that doc more than this one (since it already describes details of writing an advice class)

laurit and others added 2 commits November 10, 2021 12:45
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@trask trask merged commit 16728e2 into open-telemetry:main Nov 10, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Add a ClassAndMethod class to Instrumentation API

* remove sentence

* Update docs/contributing/writing-instrumentation.md

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* address review comment

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@laurit laurit deleted the class-and-method branch July 6, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a ClassAndMethod class to Instrumentation API?
5 participants