Class ActionTelemetry

java.lang.Object
com.google.genkit.ai.telemetry.ActionTelemetry

public class ActionTelemetry extends Object
ActionTelemetry provides metrics collection for general action execution.

This class tracks:

  • Request counts per action type
  • Latency histograms per action
  • Failure counts
  • Method Details

    • getInstance

      public static ActionTelemetry 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 name
      actionType - the action type (flow, model, tool, etc.)
      featureName - the feature name (flow name or action name)
      path - the span path
      latencyMs - the latency in milliseconds
      error - the error name if failed, null otherwise