Skip to content

Add metrics commands as experimental#175

Open
RobAtticus wants to merge 2 commits into
mainfrom
rrk/expose-metrics
Open

Add metrics commands as experimental#175
RobAtticus wants to merge 2 commits into
mainfrom
rrk/expose-metrics

Conversation

@RobAtticus

Copy link
Copy Markdown
Member

These commands can be used to get either summaries (default) of metrics, or the full series of data points. We introduce a TIGER_EXPERIMENTAL env var to enable this since the REST endpoint is currently marked as preview. After some testing, we can graduate this.

These commands can be used to get either summaries (default) of
metrics, or the full series of data points. We introduce a TIGER_EXPERIMENTAL
env var to enable this since the REST endpoint is currently marked
as preview. After some testing, we can graduate this.
@RobAtticus RobAtticus requested a review from AdrianLC July 2, 2026 19:16
@CLAassistant

CLAassistant commented Jul 2, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ AdrianLC
❌ RobAtticus
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines +15 to +28
type MetricSummary struct {
Name string `json:"name"`
Labels map[string]string `json:"labels,omitempty"`
From time.Time `json:"from"`
To time.Time `json:"to"`
Count int `json:"count"`
Min float64 `json:"min"`
MinTime time.Time `json:"min_time"`
Max float64 `json:"max"`
MaxTime time.Time `json:"max_time"`
Avg float64 `json:"avg"`
P50 float64 `json:"p50"`
P95 float64 `json:"p95"`
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just return the data points and let the agent do its own calculations.

We already have the AggFn parameter and everything, it's just not exposed in the gateway yet so if we want aggregations I would expose that instead of doing it here.

Doing average and percentiles over last value aggregations (what the API does currently) is not accurate because there is already a big lose of data points since we are only taking last_value from the samples.

The handler returns either ServiceMetricsSummaryOutput or
ServiceMetricsFullOutput depending on the requested mode, but the tool
was registered with only the summary schema. Full-mode responses failed
validation with `unexpected additional properties ["series"]`.

Register an anyOf union of both shapes. Top-level `Type: "object"` is
required by the MCP SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants