Hello,

I am planning to extend current metrics endpoint (/metrics/snapshot) to only
return a specific type of metrics (either counter, gauge or timer). It
would be great if I
can get feedback from you if this is worth pursuing, or there is an
existing solution,
or my implementation plan is sound.

Current /metrics/snapshot endpoint returns all metrics as key-value pairs
for both
master and agent. There is an additional timeout parameter for that
endpoint.
For backward compatibility, I want to add another parameter (`type` or
`metric_type`)
that will take a value of  (`counter`, `gauge` or `timer`) and the endpoint
will
only return metrics of that type.

My implement plan is to extend libprocess to support that, particularly:

1. Introduce a variable called `type` in metric.hpp
2. Extend constructors of Timer, Counter and Gauge classes to set that
variable
3. Extend Future<http::Response> MetricsProcess::_snapshot() function in
metrics.cpp to support additional query parameter

How does that sound? I would love to hear feedback from you!

Thanks,
Tuan.

Reply via email to