Repository navigation
CLI metrics UX: rename available-series, default series window, shell completions - #251
Merged
Merged
Conversation
… completions Addresses Nathan's review feedback on PR #249, except making the service ID argument optional on `details`/`available`. - Renamed `tiger service metrics available-series` to `tiger service metrics available`, matching the MCP tool name (service_metrics_available) and the shorter, hyphen-free naming direction. Updated cross-references in the other two commands' help text. - `tiger service metrics series` no longer requires --from/--to: when both are omitted, they default to the last 7 days (NOW-7d to NOW) at a 3600s (1h) bucket, so the command works without first having to construct RFC3339 timestamps. Giving just one of --from/--to still requires the other. An explicit --bucket-seconds is never overridden. Applied at the CLI layer only — the MCP tool's from/to stay required, since an agent should reason about the window it asks for. - Wired up shell completion for the service ID argument (all three metrics commands) and for --metric (`details`/`series`), which was previously not offered anywhere in the metrics command group.
Bucket size stays at 3600s (1h) for the new window.
Per timescale/savannah-gateway#2038 (comment): MetricsSeriesRequest.name and MetricDetails.name become metric_name. This repo's openapi.yaml isn't resynced from the gateway's spec yet (still blocked per #249), so this patches just these two fields by hand rather than doing the full resync early -- the eventual resync will pick up the same name once it happens.
Contributor
Author
|
b7bd14b includes renamed field from feedback in https://github.com/timescale/savannah-gateway/pull/2038#discussion_r4132931263 |
nathanjcochran
approved these changes
Sep 29, 2026
nathanjcochran
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks for making those changes 😄
AdrianLC
added a commit
that referenced
this pull request
Sep 30, 2026
AdrianLC
added a commit
that referenced
this pull request
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #249. Addresses Nathan's review feedback there, except making the service ID argument on
details/availableoptional — not sold on that one, so left alone for now.tiger service metrics available-series→tiger service metrics available, matching the MCP tool name (service_metrics_available) and the shorter, hyphen-free naming direction. Updated the cross-references indetails/series's help text;docs/cli/regenerated (old file gone, new file added).tiger service metrics seriesno longer requires--from/--to. When both are omitted, they default to the last 24 hours (NOW-24htoNOW) at a 3600s (1h) bucket — so the command works without first having to construct RFC3339 timestamps. Giving just one of--from/--tostill requires the other (no silent partial-defaulting). An explicit--bucket-secondsis never overridden by the default. This is CLI-only — the MCP tool'sfrom/tostay required, since an agent should reason about the window it's asking for, not silently get the last 24 hours. Documented in the command'sLong/flag usage text and regenerated docs.--metric(details/series, calling the same endpointavailabledoes) — previously not offered anywhere in this command group.Test plan
internal/cmd/service_metrics_available_test.go(this command had zero dedicated coverage before).internal/cmd/service_metrics_series_test.go: added cases for the default window+bucket (viasynctest, whose bubble clock starts at a fixed instant so the exact request body can be asserted), for giving only one of--from/--to, and for an explicit--bucket-secondsoverriding the default.--metric, and__completefor both the service ID argument and--metricreturn real values from the API.