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

Loki: Drop all errors in volume requests #79686

Merged
merged 1 commit into from Dec 19, 2023

Conversation

svennergr
Copy link
Contributor

What is this feature?

This PR adds a drop __error__ operation to all Loki log volume queries. By this we can also display the "histogram" in case the underlying logs are not well formatted.

Special notes for your reviewer:

On Loki devenv with the change:
image

On Loki devenv without the change:
image

@svennergr svennergr requested a review from a team as a code owner December 19, 2023 12:43
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.3.x milestone Dec 19, 2023
@@ -219,6 +219,11 @@ export class LokiDatasource
return undefined;
}

const dropErrorExpression = `${expr} | drop __error__`;
if (isQueryWithError(this.interpolateString(dropErrorExpression, placeHolderScopedVars)) === false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small safeguard that we're not breaking any query with that. Not really sure when and how that could happen though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👌

Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏

@svennergr svennergr merged commit a15681c into main Dec 19, 2023
27 checks passed
@svennergr svennergr deleted the svennergr/loki-volume-drop-errors branch December 19, 2023 13:21
@summerwollin summerwollin modified the milestones: 10.3.x, 10.3.0 Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants