-
Notifications
You must be signed in to change notification settings - Fork 476
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
Conversation
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", |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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(` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this 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
What this PR does
In this PR I'm proposing a couple of changes to query-frontend instant query splitting metrics:
evaluation
label fromcortex_frontend_instant_query_splitting_rewrites_succeeded_total
metric, and keep it focused on succeeded rewrites (so that it matches its metric name)cortex_frontend_instant_query_splitting_rewrites_skipped_total
to track metrics which haven't been split, for anyreason
(adding theparsing-failed
reason too, otherwise the count of successes + skipped doesn't matchcortex_frontend_query_sharding_rewrites_attempted_total
)Which issue(s) this PR fixes or relates to
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]