Skip to content

CLI metrics UX: rename available-series, default series window, shell completions - #251

Merged
AdrianLC merged 3 commits into
adrian/metrics-ga-ungatefrom
adrian/metrics-cli-ux
Sep 30, 2026
Merged

AdrianLC merged 3 commits into
adrian/metrics-ga-ungatefrom
adrian/metrics-cli-ux

Conversation

@AdrianLC

@AdrianLC AdrianLC commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #249. Addresses Nathan's review feedback there, except making the service ID argument on details/available optional — not sold on that one, so left alone for now.

  • Renamed 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 in details/series's help text; docs/cli/ regenerated (old file gone, new file added).
  • tiger service metrics series no longer requires --from/--to. When both are omitted, they default to the last 24 hours (NOW-24h 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 (no silent partial-defaulting). An explicit --bucket-seconds is never overridden by the default. This is CLI-only — the MCP tool's from/to stay required, since an agent should reason about the window it's asking for, not silently get the last 24 hours. Documented in the command's Long/flag usage text and regenerated docs.
  • Wired up shell completion for the service ID argument (all three metrics commands) and for --metric (details/series, calling the same endpoint available does) — previously not offered anywhere in this command group.

Test plan

  • New 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 (via synctest, 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-seconds overriding the default.
  • Manually exercised against a real service: default-window fetch returns real data with no flags beyond --metric, and __complete for both the service ID argument and --metric return real values from the API.

… 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.
@AdrianLC AdrianLC self-assigned this Sep 29, 2026
@AdrianLC
AdrianLC marked this pull request as ready for review September 29, 2026 14:42
@AdrianLC
AdrianLC requested a review from a team as a code owner September 29, 2026 14:42
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.
@AdrianLC

Copy link
Copy Markdown
Contributor Author

b7bd14b includes renamed field from feedback in https://github.com/timescale/savannah-gateway/pull/2038#discussion_r4132931263

@nathanjcochran nathanjcochran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks for making those changes 😄

@AdrianLC
AdrianLC merged commit 409e8d2 into adrian/metrics-ga-ungate Sep 30, 2026
1 of 3 checks passed
@AdrianLC
AdrianLC deleted the adrian/metrics-cli-ux branch September 30, 2026 08:46
AdrianLC added a commit that referenced this pull request Sep 30, 2026
AdrianLC added a commit that referenced this pull request Sep 30, 2026
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.

2 participants