I'd note a label selector (eg {foo="bar"}) _is_ a valid PromQL query, and
can be passed to this API...Cheers Tom On Thu, Apr 29, 2021 at 9:34 AM Bartłomiej Płotka <[email protected]> wrote: > Thanks, Ben, this is a very valid point. Is there a way we can improve > this? One solution would be: > > Update parameter name OR/And docs for exemplars query to (something like > `extract-query`). > > > - query=<string>: Prometheus expression query string. > > > Kind Regards, > Bartek Płotka (@bwplotka) > > > On Thu, Apr 29, 2021 at 1:20 AM Ben Ye <[email protected]> wrote: > >> Hi Julien, >> >> Thanks for the reply. That makes sense to me and it is very natural to >> implement it this way in Grafana. >> >> I am working on adding a new promtool subcommand for querying exemplars >> with a query flag. From the UX perspective, it is a little bit weird to let >> users provide promql queries instead of matchers. It might cause some >> confusion (at least to me). >> >> Best regards, >> Ben Ye >> >> On Wed, Apr 28, 2021 at 6:55 PM Julien Pivotto < >> [email protected]> wrote: >> >>> On 28 Apr 11:55, Ben Ye wrote: >>> > Hi Prometheus developers & maintainers, >>> > >>> > I am looking at the Exemplar API >>> > < >>> https://prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars> >>> and >>> > I have one question about the query parameter. >>> > >>> > Here query supports any promql expression. But from the code >>> > < >>> https://github.com/prometheus/prometheus/blob/main/web/api/v1/api.go#L493-L501>, >>> >>> > what we need is just label matchers to select series. Then why do we >>> use >>> > query as the parameter instead of using match[]? >>> > >>> > Best regards, >>> > Ben Ye >>> >>> It seems that it was chosen so that it was easy to get the exemplars of >>> a promql query without requiring the requester to analyze the query to >>> extract the series from the query. >>> >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups "Prometheus Developers" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> > To view this discussion on the web visit >>> https://groups.google.com/d/msgid/prometheus-developers/027851f8-93e6-47c0-9ca0-f1923508d837n%40googlegroups.com >>> . >>> >>> >>> -- >>> Julien Pivotto >>> @roidelapluie >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prometheus Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/prometheus-developers/CAAYGSaxW9GoRw0vt5X5k2TUsh%3DwZp%3D2N8-eZR%3DHL%3DAhJcAGX5g%40mail.gmail.com >> <https://groups.google.com/d/msgid/prometheus-developers/CAAYGSaxW9GoRw0vt5X5k2TUsh%3DwZp%3D2N8-eZR%3DHL%3DAhJcAGX5g%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-developers/CAMssQwZGp1U9m3rK%3DmZ%3DvQw2c3ow7NQ3my5FsNwF0_0yc81iMw%40mail.gmail.com > <https://groups.google.com/d/msgid/prometheus-developers/CAMssQwZGp1U9m3rK%3DmZ%3DvQw2c3ow7NQ3my5FsNwF0_0yc81iMw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Prometheus Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAB58Z12BOxBpE4uMADiEDrKPvWaVJkDkTeJi8cCqp-a5ZafO3A%40mail.gmail.com.

