Replies: 2 comments 9 replies
-
This idea was originally brought forward to be directly added to Prometheus. It might be way better suited here anyway. |
Beta Was this translation helpful? Give feedback.
6 replies
-
Curious about your thoughts on this @beorn7, especially given this thoughtful comment: prometheus/prometheus#7197 (comment) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If we're treating queries as a first-class concept in polly by way of signals, then it begs an obvious question - can we analyze and validate those queries directly in CUE? That is, write e.g. a PromQL parser in CUE. My computability theory is too weak to know if this is possible or not.
It seems likely this would be far too much effort/the risks arising from two parsers, but if such a parser were to exist, the value would be in not only validating that a query string is valid for the language, but about more specific properties of the query. Most obvious - it could be used to produce type information about the query return, which is a key goal anyway (another discussion item coming about this soon).
For example, @brancz and i have discussed that it's almost only ever label matchers that we want to be parameterizable. If PromQL queries could be parsed into a structure (and CUE variable interpolations retained through the parsing), it should then be straightforward to actually write a constraint, in CUE, guaranteeing that promql signals have variable interpolations on their label matchers.
That could be enforced in polly itself (probably unwise?), or provided as an optional policy that organizations consuming polly packages could choose to apply themselves. And, of course, orgs could trivially write their own policies, analogous to what Cloudflare has done with pint.
Beta Was this translation helpful? Give feedback.
All reactions