Skip to content

feat: Add timeout option to monitor DSL #1101

@dominiqueclarke

Description

@dominiqueclarke

Summary

This issue is to add a timeout field to the monitor configuration DSL. This will allow users to specify a custom timeout for their monitors directly within their Synthetics project files.

Background

This change is a dependency for a feature being implemented in Kibana (elastic/kibana#234726) that allows users to set a custom browser timeout for monitors running on Private Locations. To support this for Project Monitors, the Synthetics agent's DSL must be updated to recognize and process this new field.

Acceptance Criteria

  • A new optional timeout field is added to the MonitorConfig type.
  • The timeout field must be a string that conforms to the Go time.Duration format (e.g., "10s", "1m", "20ms").
  • The agent correctly parses this value and applies it as the overall journey timeout.
  • The timeout can be set on an individual monitor object for monitor-specific overrides.
  • The timeout can be set globally in the synthetics.config.ts file and will be inherited by all monitors unless overridden by a local setting.

Technical Action Items

  • Update Monitor DSL Definition

    • In src/dsl/monitor.ts, modify the MonitorConfig type to include a new optional field: timeout?: string.
    • Add TSDoc comments to the new field explaining that the value should be a string representing a duration (e.g., "30s", "2m").
  • Update Monitor Validation

    • Enhance the validation logic to ensure that if a timeout value is provided, it is a valid duration string. While full regex validation might be overkill, a basic check for a number followed by a unit (s, m, ms) would be beneficial.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions