Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: Add histogram metric type #386
feat: Add histogram metric type #386
Changes from 7 commits
a8d83d0
d560f64
fd5c44b
edb0533
667858e
60f1e63
349daa6
c3d478a
484c2be
d4372af
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Reuse
TRITONSERVER_MetricSet
?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.
@rmccorm4 Any thought? Basically we need to merge two funcions below into one
Metric::Set(double value)
. It works but may add confusion.core/src/metric_family.cc
Lines 338 to 404 in fd5c44b
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.
I would need to take a closer look, but my gut reaction is that Guan is probably right and we can probably just reuse
MetricValue
andMetricSet
which will call Collect and Observe internally whenkind == KIND_HISTOGRAM
if functionally equivalentThere 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.
MetricValue
may not work ifCollect
returns multiple values (one per bucket?), but again will need to take a closer look. Let me know if you already know more details on this from your research.But similar to the new C API for MetricV2, keep in mind how this would work if we added support for Summary metric and wanted to get the values for each quantile, which is basically same as values for each bucket. Ideally the same API would work for both or all types.
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.
MetricValue
cannot be reused for histogram.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.
Updated
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.
I would like to revisit this change. The consensus is to keep C API and python_backend API 1:1 matched. I am inclined to add a new C API
TRITONSERVER_MetricObserve
for histogram instead of reusingTRITONSERVER_MetricSet
for three reasons.Histogram
andSummary
types callObserve
to record new value. We can reuse observe forSummary
type if we add it in the future.ObserveMultiple
API which may be added in the future. I don't like the idea thatHistogram.Set
andHistogram.ObserveMultiple
coexist.TRITONSERVER_MetricSet
can be verbose as well in order to describe different behaviors for counter/gauge and histogram/summary.cc @Tabrizian @rmccorm4 @GuanLuo
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.
FYI
https://github.com/jupp0r/prometheus-cpp/blob/master/core/include/prometheus/histogram.h
https://github.com/jupp0r/prometheus-cpp/blob/master/core/include/prometheus/summary.h
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.
Well.. Triton metrics API is not supposed to be mirroring "Prometheus API", Prometheus is one of the "forms" we can exhibit the metrics as. So we should design the API to be using generic terms for statistics, the meaning of
gauge
/counter
/histogram
(andsummary
?) is not affected by the fact that Prometheus or other metrics libraries are used.Thinking from this mindset, my question is if
observe
is the generic verb for recording the statistics ofhistogram
. If that is the case, then I am fine to addXXXObserve
, otherwise, we should use the proper verbThere 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.
I think either sample or observe. Voting for Observe for simplicity.
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.
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.
Updated