Package com.google.genkit.ai.telemetry
Class ToolTelemetry
java.lang.Object
com.google.genkit.ai.telemetry.ToolTelemetry
ToolTelemetry provides metrics collection for tool execution.
This class tracks:
- Tool invocation counts
- Tool latency histograms
- Tool error rates
-
Method Summary
Modifier and TypeMethodDescriptionstatic ToolTelemetryGets the singleton instance of ToolTelemetry.voidrecordToolMetrics(String toolName, String featureName, String path, long latencyMs, String error) Records metrics for a tool execution.
-
Method Details
-
getInstance
Gets the singleton instance of ToolTelemetry.- Returns:
- the ToolTelemetry instance
-
recordToolMetrics
public void recordToolMetrics(String toolName, String featureName, String path, long latencyMs, String error) Records metrics for a tool execution.- Parameters:
toolName- the tool namefeatureName- the feature/flow namepath- the span pathlatencyMs- the latency in millisecondserror- the error name if failed, null otherwise
-