Skip to content

Commit

Permalink
add prometheus submodule readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard Llull authored and ellull committed Apr 3, 2023
1 parent 7d9417c commit 8dee2ca
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
fastbreaker
===========

[![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)

[fastbreaker.prometheus](https://github.com/bluekiri/fastbreaker/prometheus) simplifies regitering metrics generated from [fastbreaker](https://github.com/bluekiri/fastbreaker) into [prometheus](https://prometheus.io/).

Installation
------------

```
go get github.com/bluekiri/fastbreaker/prometheus
```

Usage
-----

The function `prometheus.RegisterMetricsToDefaultRegisterer` registers the `fastbreaker.FastBreaker` metrics with the default Registerer.

The function `prometheus.RegisterMetrics` registers the `fastbreaker.FastBreaker` metrics with the provided Registerer.

The function `RegisterMetricsWithFactory` registers the `fastbreaker.FastBreaker` metrics with the provided `promauto.Factory`.

All three functions return an error if the circuit breaker name is not a valid UTF-8 string.

Example
-------

```go
var cb fastbreaker.FastBreaker

prometheus.RegisterMetricsToDefaultRegisterer("my-circuit-breaker", cb)
```

License
-------

The MIT License (MIT)

See [LICENSE](https://github.com/bluekiri/fastbreaker/blob/master/LICENSE) for details.

0 comments on commit 8dee2ca

Please sign in to comment.