Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Feb 28, 2024
1 parent 23a058e commit b345524
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
1 change: 0 additions & 1 deletion .docker/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

global:
scrape_interval: 10s

Expand Down
58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Expand Down Expand Up @@ -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)

0 comments on commit b345524

Please sign in to comment.