You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
query_prometheus: omitted endTime fails with a PromQL parser error #1344
When a client calls query_prometheus without endTime, the tool returns parsing end time: syntax error: unexpected $end, expecting tNOW or tDIGIT at character 2 starting with "". The parameter is marked required, so as in #252 the client is at fault, but the message reads like a broken PromQL expression and the model rewrites the query instead of adding the time. In our logs this caused four failed retries across two agents, each swapping the metric name. Expected: endTime defaults to now (as parseEndTime already does for the label and metric-name tools), or the error names the missing argument, such as endTime is required.
Steps to reproduce
Call query_prometheus with {"datasourceUid":"<prometheus uid>","expr":"up","queryType":"instant"}
Observe parsing end time: syntax error: unexpected $end, expecting tNOW or tDIGIT at character 2 starting with ""
Add "endTime":"now": the same call succeeds
Reproduced on v2.0.2 built from source with a stubbed Prometheus datasource. Still present on main at 5ea0cc3: tools/prometheus.go:136 passes args.EndTime straight to parseTime, which fails on an empty string.
Activity