llama-stack-mirror/llama_stack/providers/utils/telemetry
Charlie Doern fb553f3430 feat: implement query_metrics
query_metrics currently has no implementation, meaning once a metric is emitted there is no way in llama stack to query it from the store.

implement query_metrics for the meta_reference provider which follows a similar style to `query_traces`, using the trace_store to format an SQL query and execute it

in this case the parameters for the query are `metric.METRIC_NAME, start_time, and end_time`.

this required client side changes since the client had no `query_metrics` or any associated resources, so any tests here will fail but I will provider manual execution logs for the new tests I am adding

order the metrics by timestamp.

Additionally add `unit` to the `MetricDataPoint` class since this adds much more context to the metric being queried.

these metrics can also be aggregated via a `granularity` parameter. This was pre-defined as a string like: `1m, 1h, 1d` where metrics occuring in same timespan specified are aggregated together.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2025-08-22 15:47:04 -04:00
..
__init__.py kill unnecessarily large imports from telemetry init 2024-12-08 16:57:16 -08:00
dataset_mixin.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
sqlite_trace_store.py feat: implement query_metrics 2025-08-22 15:47:04 -04:00
trace_protocol.py chore: update pre-commit hook versions (#2708) 2025-07-10 16:47:59 +02:00
tracing.py chore(pre-commit): add pre-commit hook to enforce llama_stack logger usage (#3061) 2025-08-20 07:15:35 -04:00