-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Micronaut 4 support for code origin for spans (#8039)
Make Code Origin for spans feature independent from dynamic instrumentation so it could be enabled while DI is not Add in Status Logger the code origin feature status
- Loading branch information
Showing
10 changed files
with
111 additions
and
35 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
36 changes: 36 additions & 0 deletions
36
...main/java/datadog/trace/instrumentation/micronaut/MicronautCodeOriginInstrumentation.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,36 @@ | ||
package datadog.trace.instrumentation.micronaut; | ||
|
||
import com.google.auto.service.AutoService; | ||
import datadog.trace.agent.tooling.InstrumenterModule; | ||
import datadog.trace.instrumentation.codeorigin.CodeOriginInstrumentation; | ||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
@AutoService(InstrumenterModule.class) | ||
public class MicronautCodeOriginInstrumentation extends CodeOriginInstrumentation { | ||
|
||
public static final String IO_MICRONAUT_HTTP_ANNOTATION = "io.micronaut.http.annotation."; | ||
|
||
public MicronautCodeOriginInstrumentation() { | ||
super("micronaut", "micronaut-span-origin"); | ||
} | ||
|
||
@Override | ||
public String muzzleDirective() { | ||
return "micronaut-common"; | ||
} | ||
|
||
@Override | ||
protected Set<String> getAnnotations() { | ||
return new HashSet<>( | ||
Arrays.asList( | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Get", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Post", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Put", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Delete", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Patch", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Head", | ||
IO_MICRONAUT_HTTP_ANNOTATION + "Options")); | ||
} | ||
} |
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