[native] Add config for stats reporting and counters.#21745
[native] Add config for stats reporting and counters.#21745amitkdutta merged 1 commit intoprestodb:masterfrom
Conversation
xiaoxmeng
left a comment
There was a problem hiding this comment.
@amitkdutta do we see significant cost from metric collection and report? Thanks!
There was a problem hiding this comment.
s/enableRuntimeStatsReporting/enableRuntimeMetricReporting/
This is metric but not stats. Thanks!
There was a problem hiding this comment.
The base class is called BaseStatsReporter and we have defined StatsType enum as well. We seem to use the metric/stata interchangeably throughout.
There was a problem hiding this comment.
RuntimeStats means the ad hoc added runtime stats. Metric is different: https://facebookincubator.github.io/velox/metrics.html. We should rename BaseStatsReporter to BaseMetricReporter.
@xiaoxmeng Stats reporting is optional and disabled for e2e tests. For meta internal cases, stats reporting starts a thrift service with following code in the PrestoServer wrapper: Now, @karteekmurthys is introducing stats reporting to Premetheus in #21599 where he also needs to set facebook::velox::BaseStatsReporter::registered = true; I think its better to set this in OSS instead of Meta internal wrapper as it unify how stats service is started. Besides, there is another advantage that today inside Meta we start the StatsServer first and then PrestoServer. Ideally we should start PrestoServer, read config and start Stats server if required. Also since its started from wrapper, there is a flag |
|
I am new to c++ dev, please ignore or consider as nits: Is it possible to add cmake flags instead for people to use so that they can be used in cmake files too? |
CMIW, you want COMPILE time control to enable metrics? |
|
Yes, like ignore compiling a metrics directory if user doesn't want etc and other dependencies |
e02462f to
f565c33
Compare
xiaoxmeng
left a comment
There was a problem hiding this comment.
@amitkdutta LGTM % comments. Thanks!
f565c33 to
1e559e8
Compare
1e559e8 to
ae6a0de
Compare
xiaoxmeng
left a comment
There was a problem hiding this comment.
@amitkdutta thanks for the iterating!
Adding config for stats reporting and counter registration. The code is mostly taken from #21599. Separated into a PR as this code can allow to deprecate meta internal logic to enable counters, plus simplify #21599 as well.