loki
loki copied to clipboard
Loki should allow empty selector queries
Describe the solution you'd like
Currently loki requires having at least a single non empty selector (queries require at least one regexp or equality matcher that does not have an empty-compatible value. For instance, app=~".*" does not meet this requirement, but app=~".+" will).
I think this is an unnecessary hurdle for new user and I think we rather should:
- Provide some extra help how a user can add labels to process a query quicker. (E.g. when the UI takes longer than 5 seconds suggest to shring down the result set by label x, y,z
- Workarounds do exists today to get
{}(by using a label that all streams have like{namespace=~'.+'})
Describe alternatives you've considered
Leave it as it is, while improving error message (like in #6936 )
Can you please explain how the workaround should be implemented?
Currently I'm getting the same error on this query
{project="$Project", commit="$Commit", container="$Container"} |= ""
I tried with
{namespace=~".+", project="$Project", commit="$Commit", container="$Container"} |= ""
as you suggested but the error is still present.
I also tried to pass a static selector like
{namespace="default", project="$Project", commit="$Commit", container="$Container"} |= ""
but no improvements.
@robertomanfreda your issue seems to be with |= "" not in the labels.
Any news ?
When first using loki the refusal to give back all results for an empty query was very surprising and annoying, especially since there are many examples on the internet and I believe even in the Loki docs where "{}" is used to retrieve all entries.
Anyone coming from practically any other query language will assume that query is equivalent to something like a where clause and assume that omitting the constraint will give back everything.
I agree. It should be a configuration option if there's some performance reason for this. As a new user testing out Grafana and Loki locally, I want to view all the data it has so I can see if any of my application's messages are being sent successfully. It's very confusing to determine if I can't see messages because there's no data in Loki or because my query doesn't return results.