mlflow-trace-metrics
Skill89 starsChanged 36 days agoApache-2.0View on GitHub
Query aggregate MLflow trace, span and assessment metrics for latency, tokens, counts and quality trends. Use for operational summaries rather than individual-trace diagnosis.
In this repository9 other files it gives its agents.
- mlflow-agent-improvementSkill
- mlflow-agentSkill
- mlflow-docsSkill
- mlflow-evaluationSkill
- mlflow-onboardingSkill
- mlflow-sagemakerSkill
- mlflow-trace-analysisSkill
- mlflow-trace-instrumentationSkill
- mlflow-trace-retrievalSkill
The file
Files
Query MLflow metrics
Reuse server, experiment IDs and requested window. Select the exact metric, view, aggregation and grouping needed; token counts are not currency cost.
Prerequisites
For aggregate queries, read the metrics API reference. If the task also needs individual traces, read trace retrieval before searching; if unavailable, use the search guide.
Step 1: Check the client
Resolve scripts/fetch_metrics.py relative to this skill; use --help for flags. The metrics endpoint and helper are not supported for Databricks-managed tracking. For OSS they accept HTTP(S), not databricks:// profiles, and add no authentication headers. Use an existing supported authenticated client or report the blocker; never convert a Databricks profile to a workspace URL or request pasted tokens.
Step 2: Choose metrics
Select TRACES (default), SPANS or ASSESSMENTS using the API reference. Use COUNT for entities, SUM for tokens, AVG/P95 for distributions. Do not silently substitute metrics.
Step 3: Query the time window
Query explicit bounds: epoch milliseconds, timezone-qualified ISO timestamps, now, or relative values like -24h. Buckets are seconds and require both bounds.
python <SKILL_DIR>/scripts/fetch_metrics.py -s <SERVER> -x <EXPERIMENT_ID> \
-m total_tokens -a SUM -t 3600 --start-time="-24h" --end-time=now -o jsonLatency: -m latency -a AVG,P95 -d trace_name. Numeric quality: -v ASSESSMENTS -m assessment_value -a AVG -d assessment_name. Status counts: -m trace_count -a COUNT -d trace_status. Keep the same explicit window.
Verification
Inspect actual metric_name, dimensions and values; report exact experiment/window, metric, aggregation, units, filters and coverage. Empty data_points is not zero usage; absent token instrumentation can undercount. Quality summaries need per-scorer scales and valid/error/missing denominators: zero/false can be valid, scorer failures are not zero scores, and unrelated scorers should not be averaged.
A next_page_token means partial results; the helper exposes it but cannot fetch subsequent pages. Use an existing pagination-capable client or disclose incompleteness. Counts by status are not an error rate: derive ERROR / all statuses only with a complete stated denominator. Distinguish request/auth failures from empty results. Aggregates need representative trace evidence for causal diagnosis.
References
API reference: wire fields, metric/view compatibility and metrics-specific filters.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

