Package com.google.genkit.ai.telemetry
Class ActionTelemetry
java.lang.Object
com.google.genkit.ai.telemetry.ActionTelemetry
ActionTelemetry provides metrics collection for general action execution.
This class tracks:
- Request counts per action type
- Latency histograms per action
- Failure counts
-
Method Summary
Modifier and TypeMethodDescriptionstatic ActionTelemetryGets the singleton instance of ActionTelemetry.voidrecordActionMetrics(String actionName, String actionType, String featureName, String path, long latencyMs, String error) Records metrics for an action execution.
-
Method Details
-
getInstance
Gets the singleton instance of ActionTelemetry.- Returns:
- the ActionTelemetry instance
-
recordActionMetrics
public void recordActionMetrics(String actionName, String actionType, String featureName, String path, long latencyMs, String error) Records metrics for an action execution.- Parameters:
actionName- the action nameactionType- the action type (flow, model, tool, etc.)featureName- the feature name (flow name or action name)path- the span pathlatencyMs- the latency in millisecondserror- the error name if failed, null otherwise
-