You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how_instrumentations_work.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,10 @@ To run muzzle on your instrumentation, run:
94
94
It checks that the types and methods used by the instrumentation are present in particular versions of libraries.
95
95
It can be subverted with `MethodHandle` and reflection, so muzzle passing is not the end of the story.
96
96
97
-
**TODO: discuss why 'name' is not always included.**
97
+
By default, all the muzzle directives are checked against all the instrumentations included in a module.
98
+
However, there can be situations in which it’s only needed to check one specific directive on an instrumentation.
99
+
At this point the instrumentation should override the method `muzzleDirective()` by returning the name of the directive to execute.
100
+
98
101
99
102
## Instrumentation classes
100
103
@@ -527,6 +530,8 @@ It is important to understand that even though they look like maps, since the va
527
530
retrieve a value if you use the exact same key object as when it was set. Using a different object that is “`.equals()`”
528
531
to the first will yield nothing.
529
532
533
+
Since `ContextStore` does not support null keys, null checks must be enforced _before_ using an object as a key.
534
+
530
535
## CallDepthThreadLocalMap
531
536
532
537
In order to avoid activating new spans on recursive calls to the same method
@@ -536,6 +541,8 @@ and [decremented](https://github.com/DataDog/dd-trace-java/blob/9d5c7ea524cfec98
536
541
or [reset](https://github.com/DataDog/dd-trace-java/blob/9d5c7ea524cfec982176e687a489fc8c2865e445/dd-java-agent/instrumentation/java-http-client/src/main/java11/datadog/trace/instrumentation/httpclient/SendAdvice.java#L44))
537
542
when exiting.
538
543
544
+
This only works if the methods are called on the same thread since the counter is a ThreadLocal variable.
545
+
539
546
## Span Lifecycle
540
547
541
548
In Advice classes, the `@Advice.OnMethodEnter` methods typically start spans and `@Advice.OnMethodExit` methods
0 commit comments