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

Improved query-frontend instant query splitting metrics #2564

Merged
merged 2 commits into from
Jul 28, 2022

Conversation

pracucci
Copy link
Collaborator

What this PR does

In this PR I'm proposing a couple of changes to query-frontend instant query splitting metrics:

  • Remove evaluation label from cortex_frontend_instant_query_splitting_rewrites_succeeded_total metric, and keep it focused on succeeded rewrites (so that it matches its metric name)
  • Introduce cortex_frontend_instant_query_splitting_rewrites_skipped_total to track metrics which haven't been split, for any reason (adding the parsing-failed reason too, otherwise the count of successes + skipped doesn't match cortex_frontend_query_sharding_rewrites_attempted_total)

Which issue(s) this PR fixes or relates to

N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Namespace: "cortex",
Name: "frontend_query_sharding_rewrites_attempted_total",
Help: "Total number of queries the query-frontend attempted to shard.",
Name: "cortex_frontend_query_sharding_rewrites_attempted_total",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewers: it makes the metrics easier to grep / find.

}),
}

// Initialize known label values.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewers: this is a Prometheus best practice, so that metrics are exposed even if they have 0 value.

@@ -268,35 +264,36 @@ func TestQuerySplittingCorrectness(t *testing.T) {
approximatelyEquals(t, expectedPrometheusRes, splitPrometheusRes)

// Assert metrics
assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewers: I merged the metrics assertions into a single one.

Copy link
Contributor

@colega colega left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@ssncferreira ssncferreira left a comment

Choose a reason for hiding this comment

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

LGTM 🏆
Thanks! This is a lot clearer

@pracucci pracucci enabled auto-merge (squash) July 28, 2022 07:45
@pracucci pracucci merged commit 83e2817 into main Jul 28, 2022
@pracucci pracucci deleted the improve-instant-query-splitting-metrics branch July 28, 2022 07:57
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 this pull request may close these issues.

None yet

3 participants