|emile f5a39d1278||1 year ago|
|.gitignore||1 year ago|
|Dockerfile||1 year ago|
|LICENSE||1 year ago|
|README.md||1 year ago|
|main.go||1 year ago|
A super basic server bundling metrics and exposting them
The metrics bunder is a service receiving metrics from other services bunding them for further user in prometheus and other time series databases.
First of all, writing metrics works by submitting a POST request to the /metrics endpoint:
$ url -X POST --data "key=number&value=800" https://metrics-bundler.nbg1.emile.space/metrics
After that, a GET request can be submitted to the same endpoint (
/metrics). It returns all of the
$ curl -X GET https://metrics-bundler.nbg1.emile.space/metrics number 800.000000
Prometheus can be instructed to use this by creating a new job in the prometheus configuration file:
... - job_name: 'metrics-bundler' scrape_interval: 5s static_configs: - targets: ['<hostname>:<port>'] ...
Using the job a above, prometheus is instructed to scrape the /metrics endpoint of the given host every 5 seconds.