Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index Gateway: Unable to handle GetChunkRefs/LabelValuesForMetricName with empty matchers #5965

Closed
simonswine opened this issue Apr 20, 2022 · 0 comments · Fixed by #5980
Closed

Comments

@simonswine
Copy link
Contributor

#5892 introduced a bug when label values and potentially GetChunkRefs are called with empty matchers.

$ curl -H 'localhost:3100/loki/api/v1/label/namespace/values'                                                                                                                                                                                                                                                                                               
rpc error: code = Unknown desc = parse error at line 1, col 2: syntax error: unexpected }, expecting IDENTIFIER

Expected behavior is to show all label values in that case.

chaudum added a commit that referenced this issue Apr 21, 2022
This fixes a bug in the index gateway when querying values for a label.
Since the gRPC handler for LabelValuesForMetricName in the index gateway
allows empty matchers in the LabelValuesForMetricNameRequest, we need to
check if the matchers string is an empty matcher (`{}`) before we parse
the string.

This bug was introduced with the index gateway api refactoring in #5892

Fixes: #5965

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
kavirajk pushed a commit that referenced this issue Apr 21, 2022
This fixes a bug in the index gateway when querying values for a label.
Since the gRPC handler for LabelValuesForMetricName in the index gateway
allows empty matchers in the LabelValuesForMetricNameRequest, we need to
check if the matchers string is an empty matcher (`{}`) before we parse
the string.

This bug was introduced with the index gateway api refactoring in #5892

Fixes: #5965

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
chaudum added a commit that referenced this issue Apr 21, 2022
This fixes a bug in the index gateway when querying values for a label.
Since the gRPC handler for LabelValuesForMetricName in the index gateway
allows empty matchers in the LabelValuesForMetricNameRequest, we need to
check if the matchers string is an empty matcher (`{}`) before we parse
the string.

This bug was introduced with the index gateway api refactoring in #5892

Fixes: #5965

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
chaudum added a commit that referenced this issue Apr 21, 2022
This fixes a bug in the index gateway when querying values for a label.
Since the gRPC handler for LabelValuesForMetricName in the index gateway
allows empty matchers in the LabelValuesForMetricNameRequest, we need to
check if the matchers string is an empty matcher (`{}`) before we parse
the string.

This bug was introduced with the index gateway api refactoring in #5892

Fixes: #5965

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant