فهرست منبع

Allow getting current call depth (#2184)

* Allow getting current call depth

* Add comment
Mateusz Rzeszutek 4 سال پیش
والد
کامیت
27d5786d65
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      javaagent-api/src/main/java/io/opentelemetry/javaagent/instrumentation/api/CallDepth.java

+ 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;
   }