Extracting the methods of metrics_util::registry::Registry into a trait
#481
Replies: 2 comments 1 reply
-
|
At the very least, I think such a trait should have the following methods:
And for each metric kind
Additionally, ideally |
Beta Was this translation helpful? Give feedback.
-
|
Overall, I'm in favor of trait-ifying the "backend" of an exporter, and I've talked about it a little bit in this issue: #254 (comment) I think your ideation around what the base set of functionality would be is also reasonable, too. Fallibility would also be nice because it would also for a slightly more straightforward interface around handling resource constraints and limits, instead of having to do something now like return a no-op handle, which gives no indication that the handle is actually non-functioning and has no way to even be interrogated to find that out. Happy to try and mentor this work if you're looking to contribute, as my time is very limited and working on new things from scratch is just something I can't reasonably commit to at the moment. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think one of the great features of
metrics_util::layers::Layeris how it makesRecorders composable. UsuallyRecorders hold a registry of all metrics emitted. It'd be cool if we could build and compose registry-agnosticRecorders, so that the sameRecorderimplementation could work with e.g. a registry backed by a hash map or by a struct.The
metrics_util::registry::Registrystruct is a building block that already offers a nice interface I'd expect an arbitrary registry to have: at the very least it needs to have methods to get and register metrics (used by theRecorder), and methods to visit and drain metrics (used by the "exporter", the piece of code responsible for transferring the metrics out of theRecorderand into the sink).Does this sound reasonable? Should we have a
Registrytrait, perhaps in themetrics_utilcrate?Beta Was this translation helpful? Give feedback.
All reactions