Grafana requires time range for alert rule creation with instant PromQL quieriy

Hi, I’m playing with new provisioning API for alerts and I’m getting error when I’m trying to create rule with instant PromQL query and “empty” time range:

ERRO[2022-08-22T16:12:02.643+00:00] RPC /ia.v1beta1.Rules/CreateAlertRule done in 24.130287ms with unexpected error: status: 500, body: {"message":"invalid alert query A: invalid relative time range: {From:0s To:0s}","traceID":"00000000000000000000000000000000"}  request=287c2b10-2235-11ed-b296-0242ac150002

Same error I’m getting when I’m trying to create same rule with Grafana UI and time range from: now to: now. However action Run queries works fine and I’m getting correct query results.

It’s not clear what time range should I specify for the instant query? It’s just has no sense.

1 Like