We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Introducing rust-prometheus

Formal Metadata

Title
Introducing rust-prometheus
Subtitle
How Rust makes metrics safe and fast
Title of Series
Number of Parts
561
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
This talk is to give a brief introduction to the rust-prometheus library, which is a Rust client for Prometheus, a monitoring and alerting toolkit. After a brief look at basic usage, this talk will dive into how Rust features make the library safe and fast. Finally, we will discuss some ways to use Procedural Macros to reduce metric lookup by over 10x via generated static lookups. Intended audience: Rust beginner Agenda Introduction (5 min) Self introduction What is Rust-Prometheus: A brief introduction to Prometheus and the client library How to use: A short example of using the library to collect different kind of metrics How Rust Shines Safe (5 min) Why we care about safety Type-safe generic labels: Use generic label length so that label length can be checked at compile time. Rust’s Send & Sync markers Rust’s #[must_use] attribute Fast (5 min) Why we care about performance Local !Sync metrics: Shared global metrics across threads is not efficient, e.g. causing cache eviction. Local metrics to solve under the cost of normal variables! Static metric vectors via proc_macros: A macro to provide efficient metric vectors. How static metric macro is implemented (10 min) A small explanation of the macro implementation so that listeners will have a blueprint about the capability and the approach of Rust procedural macros. Benchmarks showing speed difference. Future Plan (2 min) Thread-local metrics: Enables seamlessly local metrics and less contention More metrics, like Prometheus Summary A more consistent API Metrics pulling Contributions are welcome! Production Use Case (5 min)