Class Instrumentation.ToolExecution
java.lang.Object
com.google.adk.telemetry.Instrumentation.ClosableTelemetryScope
com.google.adk.telemetry.Instrumentation.ToolExecution
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
Instrumentation
public static final class Instrumentation.ToolExecution
extends Instrumentation.ClosableTelemetryScope
AutoCloseable telemetry tracking scope for tool executions.
-
Field Summary
Fields inherited from class Instrumentation.ClosableTelemetryScope
caughtError, closed, scope, span, startTimeNanos, telemetryContextModifier and TypeFieldDescriptionprotected @Nullable Throwableprotected final AtomicBooleanprotected final io.opentelemetry.context.Scopeprotected final io.opentelemetry.api.trace.Spanprotected final longprotected final Instrumentation.TelemetryContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHook for subclasses to run code before span ends.protected voidHook for subclasses to handle metrics recording errors.protected voidrecordMetrics(Duration elapsed, @Nullable Throwable error) Hook for subclasses to record metrics.
-
Constructor Details
-
ToolExecution
-
-
Method Details
-
beforeSpanEnd
protected void beforeSpanEnd()Description copied from class:Instrumentation.ClosableTelemetryScopeHook for subclasses to run code before span ends.- Overrides:
beforeSpanEndin classInstrumentation.ClosableTelemetryScope
-
recordMetrics
Description copied from class:Instrumentation.ClosableTelemetryScopeHook for subclasses to record metrics.- Specified by:
recordMetricsin classInstrumentation.ClosableTelemetryScope
-
handleMetricsError
Description copied from class:Instrumentation.ClosableTelemetryScopeHook for subclasses to handle metrics recording errors.- Specified by:
handleMetricsErrorin classInstrumentation.ClosableTelemetryScope
-