https://github.com/simonpasquier/instrumented_app
https://github.com/simonpasquier/instrumented_app
example prometheus prometheus-client
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simonpasquier/instrumented_app
- Owner: simonpasquier
- License: apache-2.0
- Created: 2017-11-23T13:51:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-20T15:10:06.000Z (over 1 year ago)
- Last Synced: 2025-03-25T03:25:02.748Z (10 months ago)
- Topics: example, prometheus, prometheus-client
- Language: Go
- Size: 359 KB
- Stars: 0
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/simonpasquier/instrumented_app)
This is an example of application instrumented for Prometheus. By default it
listens on port 8080 and exposes metrics on the `/metrics` endpoint.
The root endpoint will respond with a random delay (1 second at most).
Exposed metrics:
* `orders_total`, a fast moving counter.
* `order_errors_total{stage=}`, a slow moving counter.
* `user_sessions`, a gauge value randomly set between 0 and 100.
## Usage
```
$ ./instrumented_app --help
usage: instrumented_app []
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--listen="127.0.0.1:8080" Listen address
--listen-metrics="" Listen address for exposing metrics (default to 'listen' if blank)
--basic-auth="" Basic authentication (eg :)
```