https://github.com/coolapso/prometheus-exporter-boilerplate
Working boilerplate code to create a prometheus exporter
https://github.com/coolapso/prometheus-exporter-boilerplate
Last synced: about 1 month ago
JSON representation
Working boilerplate code to create a prometheus exporter
- Host: GitHub
- URL: https://github.com/coolapso/prometheus-exporter-boilerplate
- Owner: coolapso
- License: mit
- Created: 2024-08-18T13:23:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T13:25:24.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T14:38:42.781Z (almost 2 years ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PROMETHEUS EXPORTER BOILERPLATE
A working example to build prometheus exporter
## Features
* Cobra and Viper to handle environment variables and cli flags
* standard library logger with `log/slog`
* Working Dockerfile example to build multi arch docker images
## How to get started
Just copy the project and tweak it to your needs.
## Structure
*cmd/* contains the CLI aspect of the exporter, loads the CLI flags, initializes the settings, the exporter and starts the web server.
*internal/* contains the internal packages for the different components of the exporter, this packages are only to be used by the project and cannot be imported by other projects
*internal/collectors* contains the exporter logic
*internal/httpServer* contains the http server responsible for serving the metrics
*internal/slogLogger* contains the logger initialization logic
# Contributions
Improvements and suggestions are always welcome, feel free to check for any open issues, open a new Issue or Pull Request
If you like this project and want to support / contribute in a different way you can always:
# Projects built using this example
* [prometheus-twitch-exporter](https://github.com/coolapso/prometheus-twitch-exporter)