about summary refs log tree commit diff
diff options
context:
space:
mode:
authoremile <hanemile@protonmail.com>2019-03-14 14:55:27 +0000
committeremile <hanemile@protonmail.com>2019-03-14 14:55:27 +0000
commit99d1243082df2f1c8e1d3268652a14cee4aab462 (patch)
tree7bd05d61acd90e8115b7ccfc2d28b15f6498b3f7
parent2a7bad97cdaefef5f81d56a329022c9000b80378 (diff)
Added a simple description
-rw-r--r--README.md35
1 files changed, 34 insertions, 1 deletions
diff --git a/README.md b/README.md
index e5a453b..4685d7e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,36 @@
 # metrics-bundler
 
-The metrics bunder is a service receiving metrics from other services bunding them for further user in prometheus and other time series databases.
\ No newline at end of file
+The metrics bunder is a service receiving metrics from other services bunding them for further user in prometheus and other time series databases.
+
+## Functions (read / write metrics)
+
+First of all, writing metrics works by submitting a POST request to the /metrics endpoint:
+
+```bash
+$ 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
+metrics submitted:
+
+```bash
+$ curl -X GET https://metrics-bundler.nbg1.emile.space/metrics                                                                       
+number 800.000000
+```
+
+## Prometheus integration
+
+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.
\ No newline at end of file