feat: Setup initial metrics infrastructure #289
Merged
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.
This adds something that I've been wanting implemented for a while. Metrics recording and emission 🎉
There's a new section in the config file that sets the metrics recorder
It's unset by default which uses the noop recorder (aka as cheap as it can get)
Log Recorder
(this one took a bit of work since it implements a recorder from "scratch")
When it's set to
"log"
the metrics start getting recorded as tracing events with some metadata attached on the span. This makes it possible to filter things pretty dynamically, and is accessible as a user doesn't need to download anything else to see the valuesTCP Recorder
When it's set to
"tcp"
the metrics get emitted following the defaultmetrics-exporter-tcp
configuration. This means that anything that knows how to consume that can handle displaying the data live. Currently the only main program I know of is themetrics-observer
binary crate, but it's unfortunately a bit limitedmetrics_observer.mp4