Go to file
Olivier 'reivilibre' f36f3e19a9 Fix licence and metadata 2022-04-01 19:36:28 +01:00
examples Initial version 2022-03-23 06:55:02 +00:00
src Initial version 2022-03-23 06:55:02 +00:00
.gitignore Initial version 2022-03-23 06:55:02 +00:00
Cargo.toml Fix licence and metadata 2022-04-01 19:36:28 +01:00
LICENCE.Apache2 Fix licence and metadata 2022-04-01 19:36:28 +01:00
LICENCE.MIT Fix licence and metadata 2022-04-01 19:36:28 +01:00
README.md Fix licence and metadata 2022-04-01 19:36:28 +01:00

README.md

metrics-process-promstyle: Prometheus-style process metrics for the metrics façade

This crate provides Prometheus-style 'process metrics' for the backend-agnostic metrics façade.

Although these metrics use the conventional Prometheus names, they can be used with any metrics-compatible exporter!

Process metrics are the following useful statistics:

  • CPU time
  • memory usage
  • start time of the process
  • number of threads

Unimplemented process metrics:

  • process_open_fds
  • process_max_fds
  • process_virtual_memory_max_bytes
  • process_heap_bytes

Usage

Once your metrics exporter is set up, you can describe the process metrics using describe().

The metrics crate only provides for 'push'-style metrics; there's no way right now to emit statistics on demand. For that reason, this crate exposes a function called emit_now() which, as the name implies, emits the statistics when called. You'll need to call this occasionally (from a background thread or Tokio task etc, if necessary) to update the metrics.

(One day, it should be as easy as enabling a feature in this crate and calling the necessary function to set up a timer for you.)

See the examples directory for an example.

Versioning

For simplicity's sake, this crate will follow the major version number of metrics, so it's easy to tell that compatible versions are being used. This means that version 0.18.x of this crate will be compatible with metrics 0.18.x, and a hypothetical version 1.x.x of this crate will be compatible with metrics 1.x.x.

Contributions

If you feel like you want to make a contribution, I would be very happy to accept.

Licence

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 licence, shall be dual licensed as above, without any additional terms or conditions.