Skip to content

Commit 8dee2ca

Browse files
Eduard Llullellull
authored andcommitted
add prometheus submodule readme
1 parent 7d9417c commit 8dee2ca

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

prometheus/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
fastbreaker
2+
===========
3+
4+
[![Go Reference](https://pkg.go.dev/badge/github.com/bluekiri/fastbreaker/prometheus.svg)](https://pkg.go.dev/github.com/bluekiri/fastbreaker/prometheus) [![CI](https://github.com/bluekiri/fastbreaker/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/bluekiri/fastbreaker/actions/workflows/ci.yml)
5+
6+
[fastbreaker.prometheus](https://github.com/bluekiri/fastbreaker/prometheus) simplifies regitering metrics generated from [fastbreaker](https://github.com/bluekiri/fastbreaker) into [prometheus](https://prometheus.io/).
7+
8+
Installation
9+
------------
10+
11+
```
12+
go get github.com/bluekiri/fastbreaker/prometheus
13+
```
14+
15+
Usage
16+
-----
17+
18+
The function `prometheus.RegisterMetricsToDefaultRegisterer` registers the `fastbreaker.FastBreaker` metrics with the default Registerer.
19+
20+
The function `prometheus.RegisterMetrics` registers the `fastbreaker.FastBreaker` metrics with the provided Registerer.
21+
22+
The function `RegisterMetricsWithFactory` registers the `fastbreaker.FastBreaker` metrics with the provided `promauto.Factory`.
23+
24+
All three functions return an error if the circuit breaker name is not a valid UTF-8 string.
25+
26+
Example
27+
-------
28+
29+
```go
30+
var cb fastbreaker.FastBreaker
31+
32+
prometheus.RegisterMetricsToDefaultRegisterer("my-circuit-breaker", cb)
33+
```
34+
35+
License
36+
-------
37+
38+
The MIT License (MIT)
39+
40+
See [LICENSE](https://github.com/bluekiri/fastbreaker/blob/master/LICENSE) for details.

0 commit comments

Comments
 (0)