-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code attributes to several instrumentations (open-telemetry#6365)
* Add code attributes to several instrumentations * fix servlet tests * fix tests * fix elasticsearch tests * fix context bridge test * fix rxjava tests * fix spring webmvc tests
- Loading branch information
Showing
28 changed files
with
585 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ntelemetry/javaagent/instrumentation/extensionannotations/MethodCodeAttributesGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.extensionannotations; | ||
|
||
import io.opentelemetry.instrumentation.api.instrumenter.code.CodeAttributesGetter; | ||
import java.lang.reflect.Method; | ||
|
||
enum MethodCodeAttributesGetter implements CodeAttributesGetter<Method> { | ||
INSTANCE; | ||
|
||
@Override | ||
public Class<?> codeClass(Method method) { | ||
return method.getDeclaringClass(); | ||
} | ||
|
||
@Override | ||
public String methodName(Method method) { | ||
return method.getName(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...try/javaagent/instrumentation/extensionannotations/MethodRequestCodeAttributesGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.extensionannotations; | ||
|
||
import io.opentelemetry.instrumentation.api.instrumenter.code.CodeAttributesGetter; | ||
|
||
enum MethodRequestCodeAttributesGetter implements CodeAttributesGetter<MethodRequest> { | ||
INSTANCE; | ||
|
||
@Override | ||
public Class<?> codeClass(MethodRequest methodRequest) { | ||
return methodRequest.method().getDeclaringClass(); | ||
} | ||
|
||
@Override | ||
public String methodName(MethodRequest methodRequest) { | ||
return methodRequest.method().getName(); | ||
} | ||
} |
Oops, something went wrong.