ソースを参照

Allow getting current call depth (#2184)

* Allow getting current call depth

* Add comment
Mateusz Rzeszutek 4 年 前
コミット
27d5786d65

+ 8 - 0
javaagent-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/CallDepth.java

@@ -20,6 +20,14 @@ public final class CallDepth {
     return --this.depth;
   }
 
+  /**
+   * Get current call depth. This method may be used by vendor distributions to extend existing
+   * instrumentations.
+   */
+  public int get() {
+    return depth;
+  }
+
   void reset() {
     depth = 0;
   }