Package com.google.genkit.ai.telemetry
Class FeatureTelemetry
java.lang.Object
com.google.genkit.ai.telemetry.FeatureTelemetry
FeatureTelemetry provides metrics collection for top-level feature (flow)
execution.
This class tracks:
- Feature request counts
- Feature latency histograms
- Path-level metrics for observability
Features in Genkit are the entry points to AI functionality, typically flows that users interact with directly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FeatureTelemetryGets the singleton instance of FeatureTelemetry.voidrecordFeatureMetrics(String featureName, String path, long latencyMs, String error) Records metrics for a feature (root flow) execution.voidrecordPathMetrics(String featureName, String path, long latencyMs, String error) Records metrics for a path within a flow.
-
Method Details
-
getInstance
Gets the singleton instance of FeatureTelemetry.- Returns:
- the FeatureTelemetry instance
-
recordFeatureMetrics
Records metrics for a feature (root flow) execution.- Parameters:
featureName- the feature namepath- the span pathlatencyMs- the latency in millisecondserror- the error name if failed, null otherwise
-
recordPathMetrics
Records metrics for a path within a flow.- Parameters:
featureName- the feature namepath- the full path including step typeslatencyMs- the latency in millisecondserror- the error name if failed, null otherwise
-