Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deadtrickster/prometheus-cowboy
Expose Prometheus metrics using cowboy/cowboy2
https://github.com/deadtrickster/prometheus-cowboy
cowboy erlang instrumentation monitoring prometheus
Last synced: 20 days ago
JSON representation
Expose Prometheus metrics using cowboy/cowboy2
- Host: GitHub
- URL: https://github.com/deadtrickster/prometheus-cowboy
- Owner: deadtrickster
- License: mit
- Created: 2017-07-02T07:53:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T06:39:31.000Z (9 months ago)
- Last Synced: 2024-12-27T01:07:02.195Z (27 days ago)
- Topics: cowboy, erlang, instrumentation, monitoring, prometheus
- Language: Erlang
- Size: 2.25 MB
- Stars: 21
- Watchers: 4
- Forks: 20
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prometheus_cowboy #
Copyright (c) 2017 Ilya Khaprov <>.
__Version:__ 0.1.8
[![Hex.pm][Hex badge]][Hex link]
[![Hex.pm Downloads][Hex downloads badge]][Hex link]
[![Build Status][Travis badge]][Travis link]## Exporting metrics with handlers
Cowboy 1:
```erlang
Routes = [
{'_', [
{"/metrics/[:registry]", prometheus_cowboy1_handler, []},
{"/", toppage_handler, []}
]}
]```
Cowboy 2:
```erlang
Routes = [
{'_', [
{"/metrics/[:registry]", prometheus_cowboy2_handler, []},
{"/", toppage_handler, []}
]}
]```
## Exporting Cowboy2 metrics
```erlang
{ok, _} = cowboy:start_clear(http, [{port, 0}],
#{env => #{dispatch => Dispatch},
metrics_callback => fun prometheus_cowboy2_instrumenter:observe/1,
stream_handlers => [cowboy_metrics_h, cowboy_stream_h]})```
## Contributing
Section order:
- Types
- Macros
- Callbacks
- Public API
- Deprecations
- Private PartsInstall the `git` pre-commit hook:
```bash
./bin/pre-commit.sh install
```
The pre-commit check can be skipped by passing `--no-verify` to `git commit`.
## License
MIT
[Hex badge]: https://img.shields.io/hexpm/v/prometheus_cowboy.svg?maxAge=2592000?style=plastic
[Hex link]: https://hex.pm/packages/prometheus_cowboy
[Hex downloads badge]: https://img.shields.io/hexpm/dt/prometheus_cowboy.svg?maxAge=2592000
[Travis badge]: https://travis-ci.org/deadtrickster/prometheus-cowboy.svg?branch=version-3
[Travis link]: https://travis-ci.org/deadtrickster/prometheus-cowboy
[Coveralls badge]: https://coveralls.io/repos/github/deadtrickster/prometheus-cowboy/badge.svg?branch=master
[Coveralls link]: https://coveralls.io/github/deadtrickster/prometheus-cowboy?branch=master## Modules ##
prometheus_cowboy
prometheus_cowboy1_handler
prometheus_cowboy2_handler
prometheus_cowboy2_instrumenter