<div align="center">
<img src="https://devhub.vip/pages/docs/img/hyperlane.png" alt="hyperlane-plugin-metrics logo" height="120">
# hyperlane-plugin-metrics
**Lock-Free Atomic Prometheus & OpenMetrics Observability Plugin**
[](https://crates.io/crates/hyperlane-plugin-metrics)
[](https://docs.rs/hyperlane-plugin-metrics)
[](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[](https://www.rust-lang.org)
[](../../LICENSE)
[Workspace Overview](../../README.md) · [Plugin Catalog](../README.md) · [API Docs](https://docs.rs/hyperlane-plugin-metrics/latest/)
</div>
---
## Overview
`hyperlane-plugin-metrics` instruments [`hyperlane`](../../README.md) servers with lock-free atomic HTTP request counters, in-flight gauges, latency histograms, and a Prometheus OpenMetrics `/metrics` scrape endpoint (hook order `-115` / `95`). It is opt-in and transparent (`Status::Continue`) when unconfigured.
## Installation
```sh
cargo add hyperlane-plugin-metrics
```
## Usage
```rust
use hyperlane_plugin_metrics::{MetricsConfig, MetricsPlugin};
fn setup_metrics() {
MetricsPlugin::init(MetricsConfig::default());
}
```
## Verification
```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-metrics --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-metrics --all-features
```
## License
This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.
## Contact
For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).