Skip to content

feat: Add minutes-only timeout parameter to monitor config and format for Kibana#1114

Closed
maramos-elastic wants to merge 1 commit intoelastic:mainfrom
maramos-elastic:new-timeout-param
Closed

feat: Add minutes-only timeout parameter to monitor config and format for Kibana#1114
maramos-elastic wants to merge 1 commit intoelastic:mainfrom
maramos-elastic:new-timeout-param

Conversation

@maramos-elastic
Copy link
Copy Markdown

Fixes #133

Summary

  • Add support for a minutes-only timeout parameter for monitors.
  • Internally accept numeric minutes; when pushing to Kibana the timeout is formatted as a string with a time unit (m) suffix (e.g. 3m) to match Kibana's expected normalization

What changed

  • CLI: expose --timeout <minutes> and wire it through push commands.
  • Types: add timeout?: number to monitor config usage and include it in shared args.
  • Runner: pass timeout through monitor defaults.
  • Push / Schema: convert numeric minutes → string (e.g. 5m) and update MonitorSchema.timeout to string for the outgoing payload.
  • Tests: add unit tests ensuring buildMonitorSchema formats timeout as '5m' and omits it when unspecified.

Verification

  • Run unit tests:
    All tests passed

  • Manual push used for verification (example):

node ./dist/cli.js push --auth "<base64-apikey>" --timeout 3 --yes
# Expect: "✓ Pushed: ..."

Notes for reviewers

  • The change preserves an internal minutes-only numeric representation (simple UX for CLI/config) while ensuring the outgoing payload meets Kibana's string-with-units requirement - similar to schedule param
  • Consider whether to accept other units (seconds/hours) or already-formatted timeout strings in future enhancements; current scope enforces minutes-only.

Release note

  • Added timeout parameter to monitor configuration (minutes-only).

Add --timeout <minutes> CLI option to override the default monitor timeout.
Similar to --schedule, this allows setting the timeout at the global, project,
or individual monitor level.

The timeout value is specified in minutes and is converted to the format
expected by Kibana (e.g., '3m' for 3 minutes) when pushing monitors.

Changes:
- Add timeout field to MonitorConfig type
- Add timeout to BaseArgs for CLI options
- Add --timeout option to push command
- Pass timeout through runner to monitor schema
- Format timeout as string with 'm' suffix for Kibana API compatibility
- Add unit tests for timeout formatting
@maramos-elastic
Copy link
Copy Markdown
Author

maramos-elastic commented Feb 4, 2026

There's a design open issue

Closing this PR in favor of #1113

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.

Configurable timeouts (UJ and Step Level)

1 participant