Go to file
Toby Lawrence 6ca2bcf097
runtime: add proxy metric support (#39)
2019-07-28 20:10:56 -04:00
ci Add CI via Azure Pipelines to actually run all our new tests. 2019-05-29 23:07:14 -04:00
metrics runtime: add proxy metric support (#39) 2019-07-28 20:10:56 -04:00
metrics-core runtime: add proxy metric support (#39) 2019-07-28 20:10:56 -04:00
metrics-exporter-http feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
metrics-exporter-log feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
metrics-observer-json feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
metrics-observer-prometheus feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
metrics-observer-text feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
metrics-runtime runtime: add proxy metric support (#39) 2019-07-28 20:10:56 -04:00
metrics-util feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
.gitignore Initial commit. 2019-03-26 08:36:44 -04:00
CODE_OF_CONDUCT.md Small UI tweak to the CoC. 2019-04-24 08:09:13 -04:00
COPYRIGHT Add label support + rename crates. (#27) 2019-07-05 21:14:08 -04:00
Cargo.toml feature: add a JSON observer (#38) 2019-07-23 12:25:49 -04:00
LICENSE Initial workspace config + metrics-core. 2019-03-26 08:41:12 -04:00
README.md Add project layout information to the README (#40) 2019-07-25 09:17:35 -04:00
azure-pipelines.yml Add CI via Azure Pipelines to actually run all our new tests. 2019-05-29 23:07:14 -04:00

README.md

metrics

conduct-badge downloads-badge release-badge docs-badge license-badge

metrics is a high-quality, batteries-included metrics library for Rust.

code of conduct

NOTE: All conversations and contributions to this project shall adhere to the Code of Conduct.

what's it all about?

Running applications in production can be hard when you don't have insight into what the application is doing. We're lucky to have so many good system monitoring programs and services to show us how are servers are performing, but we still have to do the work of instrumenting our applications to gain deep insight into their behavior and performance.

metrics makes it easy to instrument your application to provide real-time insight into what's happening. It provides a straight-forward interface for you to collect metrics at different points, and a flexible approach to exporting those metrics in a way that meets your needs.

Some of the most common scenarios for collecting metrics from an application:

  • see how many times a codepath was hit
  • track the time it takes for a piece of code to execute
  • expose internal counters and values in a standardized way

The number of reasons why you'd want to collect metrics is too large to list out here, and some applications emit metrics that have nothing to do with the application performance itself! Ultimately, metrics strives to simply provide support for the most basic types of metrics so that you can spend more time focusing on the data you'd like to collect and less time on how you're going to accomplish that.

high-level technical features

  • Supports the three most common metric types: counters, gauges, and histograms.
  • Based on metrics-core for composability at the exporter level.
  • Access to ultra-high-speed timing facilities out-of-the-box with quanta.
  • Scoped metrics for effortless nesting.
  • Bundled with Prometheus pull endpoint capabilities by default.

project layout

Metrics provide a way to gather metrics from your application. Exporters provide a way to get data outside of the application and observers tell the exporters what format to use.

Application developers can use the metrics-runtime crate to get running quickly.

  • [metrics]: Provides macros similar to the log crate.

  • [metrics-core]: Defines foundational traits for interoperable metrics libraries.

  • [metrics-exporter-http]: Exports metrics over an HTTP server.

  • [metrics-exporter-log]: Exports metrics by outputting to console using the log crate.

  • [metrics-observer-json]: Encodes metrics in the JSON format.

  • [metrics-observer-prometheus]: Encodes metrics in the Prometheus exposition format.

  • [metrics-observer-text]: Encodes metrics as text suitable for console logging.

  • [metrics-runtime]: A batteries included metrics library.

  • [metrics-util]: Helper library used in the metrics ecosystem.

performance

High. metrics is fast enough that you'll barely notice the overhead.

There is a benchmark example in the crate that can be run to see the type of performance achievable on your system. A 2015 MacBook Pro (4c/8t, 2.1GHz) can push over 5 million samples per second from a single thread.