Skip to content

metrics trends --from/--to flags are ignored (empty query values) #20

@0xble

Description

@0xble

Summary

metrics trends reads from/to through globally-colliding Viper keys, so provided flags may be dropped and sent as empty strings.

Repro

eightctl metrics trends --from 2026-02-20 --to 2026-02-21 -v

Actual

Request can be emitted with:

.../trends?from=&to=&...

Additionally, current app-api now requires tz, so missing timezone can trigger:

{ "error": "\"tz\" is required" }

Expected

CLI should:

  1. Preserve provided --from/--to values.
  2. Include tz consistently (e.g., from configured timezone or local timezone).

Suggested Fix

  1. Read from/to directly from cmd.Flags().GetString(...) for this command.
  2. Stop binding shared from/to keys globally via Viper for unrelated commands.
  3. Add tz query parameter when calling trends endpoint.

I have implemented and use this fix on a local fork, feel free to reference my implementation diff: https://gist.github.com/0xble/3c658a06df85667034038d1177559d8c

Environment

  • macOS (Apple Silicon)
  • eightctl 0.1.0-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions