MetricsProvider defines the interface for fetching available metrics from any datasource type (Prometheus, Loki, Mimir, etc.). Each datasource type implements its own provider.
| 10 | // from any datasource type (Prometheus, Loki, Mimir, etc.). |
| 11 | // Each datasource type implements its own provider. |
| 12 | type MetricsProvider interface { |
| 13 | // GetMetrics fetches available metric names from the datasource. |
| 14 | // Returns the metrics list and recommended TTL for caching. |
| 15 | // The client parameter should have proper authentication configured. |
| 16 | GetMetrics(ctx context.Context, datasourceUID, datasourceURL string, |
| 17 | client *http.Client) (*MetricsResult, error) |
| 18 | } |
| 19 | |
| 20 | // MetricsResult contains fetched metrics and recommended TTL for caching. |
| 21 | type MetricsResult struct { |
no outgoing calls
no test coverage detected