eolivelli commented on a change in pull request #854: ZOOKEEPER-3143 Pluggable
metrics system for ZooKeeper - Data Collection on Server
URL: https://github.com/apache/zookeeper/pull/854#discussion_r271914727
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/Commands.java
##########
@@ -392,8 +392,12 @@ public CommandResponse run(ZooKeeperServer zkServer,
Map<String, String> kwargs)
response.put("observer_master_id",
((ObserverZooKeeperServer)zkServer).getObserver().getLearnerMasterId());
}
- response.putAll(ServerMetrics.getAllValues());
-
+ ServerMetrics.getMetrics()
+ .getMetricsProvider()
+ .dump(
+ (metric, value) -> {
Review comment:
@enixon
Currently the API does not specify any ordering requirement.
Do you think it is needed?
If it is needed I wonder if we have to declare a specific ordering (by key?)
or should we impose that the relative order of keys should not change over time
(I image that new keys can appear and some keys may disappear) ?
Personally I wouldn't set any constraint and leave the result up to the
provider.
Please note that we are also not requiring that the same key can appear only
once with this kind of API
This new implementation (DefaultMetricsProvider) does not track any
ordering.
Let me also add that maybe new Providers may not expose data to this
'commands' and they will have an empty 'dump' method (Prometheus will expose
metrics using its own endpoint, some provider will use JMX...)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services