Prometheus query syntax for annotation events

Hi,

I’m having a similar issue than Prometheus Annotation Issue when trying to draft a prometheus query to be used to fetch annotation events.

My prometheus query returns 0 and 1, but after adding it to annotations, I don’t see it displayed.

my prometheus query is properly displaying as a range vector with values between 0 and 1, but annotations are not displayed in panels

image

Here is my promql query:

max ( #over the web nodes maintaining counters
  increase(concourse_builds_finished{bosh_deployment=~"$bosh_deployment",status="succeeded",exported_job="hard-reset-features-merged"}[5m]) > bool 0

) 

docs at docs/features/datasources/prometheus/#annotations mentions a “regular metric query” but I’m not sure whether this means a prometheus “Range vector” ?

Manually defined annotations are properly displayed within multiple panels, but query annotations do not display

Are annotations not displayed because of the step param filtering out events ?

I had posted additional screenshots in the related issue linked above (given new users are limited to 2 post, I’m not reposting them here to avoid too much spam)

Should I instead find a promql query that only return the 1 value ? I did not manage to do so. Failed so far to get inspiration from other online examples such as wikitech.wikimedia.org

Thanks in advance for your help

Hello @bercheg,

did you manage to resolve your issue? I have exactly the same issue and I am beginnning to think, that this is a bug in grafana.

Best, Marcel