diff --git a/.docker/prometheus.yml b/.docker/prometheus.yml index 4d16fc0..1c7522c 100644 --- a/.docker/prometheus.yml +++ b/.docker/prometheus.yml @@ -1,4 +1,3 @@ - global: scrape_interval: 10s diff --git a/README.md b/README.md index ce09bc2..b75e9ca 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ $ curl localhost:8080/v1/metrics ### Metrics for prometheus -If you want to use `imalive` as a metrics exporter, this is the way: +If you want to use `imalive` as a Prometheus metrics exporter, this is the way: ```shell $ curl localhost:8080/v1/prom @@ -144,6 +144,20 @@ disk_total 56.096561431884766 # HELP imalive_imalive_http_reques ``` +Here's an example of Prometheus config for scraping the data: + +```yaml +global: + scrape_interval: 10s + +scrape_configs: + - job_name: 'imalive' + static_configs: + - targets: ['imalive-api:8080'] + metrics_path: '/v1/prom' + scheme: http +``` + ## Heartbit You can change the wait time between two heartbit with the `WAIT_TIME` environment variable (in seconds). @@ -172,6 +186,48 @@ And your metrics on Prometheus like this: ![prometheus](./img/prometheus.png) +Here's an example of Prometheus configuration for scrapping the opentelemetry collector metrics: + +```yaml +global: + scrape_interval: 10s + +scrape_configs: + - job_name: 'opentelemetry' + static_configs: + - targets: ['otel-collector:8889'] +``` + +And the opentelemetry collector configuration as well for receiving the traces and metrics from imalive: + +```yaml +receivers: + otlp: + protocols: + grpc: + http: + +exporters: + debug: + prometheus: + endpoint: "0.0.0.0:8889" + const_labels: + otel: otel + otlp: + endpoint: "jaeger:4317" + tls: + insecure: true + +service: + pipelines: + metrics: + receivers: [otlp] + exporters: [prometheus] + traces: + receivers: [otlp] + exporters: [otlp] +``` + ## Development / contributions Go see this [documentation](./CONTRIBUTING.md)