-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Consolidate query metrics and include result tag #1075
Conversation
scoped := metricsFactory.Namespace(namespace, nil) | ||
metrics.Init(qMetrics, scoped, nil) | ||
qMetrics := &queryMetrics{ | ||
Errors: scoped.Counter("requests", map[string]string{"result": "err"}), |
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.
Is there a better name than requests
and/or responses
?
requests
= number of query operations performed
responses
= number of items returned per request
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.
responses = number of items returned per request
what items? traces, spans?
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.
It depends on which operation: find traces, get operations, get services and get trace.
So jaeger_find_traces_responses
would be tracking the number of traces returned.
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.
On reflection, requests
and responses
is probably ok - the requests
is a counter, so should be obvious relates to number of requests. responses
is a histogram to represent the number of items in each response.
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.
Seems this discussion has finished already, but how about "operations" and "results"?
Even though "requests/responses" is probably OK as well, I would avoid it as it's a bit of a loaded term.
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.
Have removed the additional part of the name for those counters, so now it is just:
jaeger_query_find_traces{result="err"} 0
jaeger_query_find_traces{result="ok"} 1
jaeger_query_find_traces_latency_bucket{result="err",le="0.005"} 0
jaeger_query_find_traces_latency_bucket{result="ok",le="0.005"} 1
jaeger_query_find_traces_responses_bucket{le="0.005"} 1
Codecov Report
@@ Coverage Diff @@
## master #1075 +/- ##
======================================
Coverage 100% 100%
======================================
Files 140 140
Lines 6622 6625 +3
======================================
+ Hits 6622 6625 +3
Continue to review full report at Codecov.
|
7663db2
to
eda163f
Compare
@jaegertracing/jaeger-maintainers Updated description with the new equivalent metrics. Any thoughts on the new names/tags? |
Signed-off-by: Gary Brown <[email protected]>
eda163f
to
aab7dca
Compare
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, but could you also add an entry to the changelog, mentioning that this is a breaking change? People relying on an existing metric name will get affected by this change.
} | ||
|
||
func (q *queryMetrics) emit(err error, latency time.Duration, responses int) { | ||
q.Attempts.Inc(1) |
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.
Is Attempts
being used elsewhere?
scoped := metricsFactory.Namespace(namespace, nil) | ||
metrics.Init(qMetrics, scoped, nil) | ||
qMetrics := &queryMetrics{ | ||
Errors: scoped.Counter("requests", map[string]string{"result": "err"}), |
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.
Seems this discussion has finished already, but how about "operations" and "results"?
Even though "requests/responses" is probably OK as well, I would avoid it as it's a bit of a loaded term.
Signed-off-by: Gary Brown <[email protected]>
Signed-off-by: Gary Brown <[email protected]>
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
Successes: scoped.Counter("", map[string]string{"result": "ok"}), | ||
Responses: scoped.Timer("responses", nil), | ||
ErrLatency: scoped.Timer("latency", map[string]string{"result": "err"}), | ||
OKLatency: scoped.Timer("latency", map[string]string{"result": "ok"}), |
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.
why not use the annotation-based initialization as before? It keeps declaration of the struct and metrics name in a single place.
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.
Fixed in #1096
Signed-off-by: Gary Brown [email protected]
Which problem is this PR solving?
Currently jaeger-query produces a set of metrics for the following operations: find traces, get operations, get services and get trace.
The set of metrics are (only showing one bucket for histograms):
Errors and successes for latency and counters are separated out (including a further counter representing the total counts).
This PR consolidates the metrics to use common name with a
result
tag representing ok or err states.Short description of the changes
Have a single counter
find_traces_requests
with tag result (ok, err) to replace the attempts/errors/successes counters. So total (successes) is the count(find_traces_requests) and errors/successes can be determined by querying based on the tag.Also combined the two latency based metrics and added a tag for result (ok/err).
NOTE: Have not included the
sum
andcount
values for the histograms.