Test application for using otel-collector as Prometheus and then send it to Prometheus. Purpose is to test viability of the otel-collector as a prometheus scraper, which can later be used with a third-party backend or another prometheus.
Uses a test nodejs app which exposes default prometheus metrics as a docker image. Other images are official images from the official prometheus and otel websites.
- Clone this repository
- Navigate to root of local repository
- Run:
docker compose up
After running the compose project, you can check the progress by running the following on your web browser:
- localhost:80/metrics -> Shows metrics exposed locally by application
- localhost:8888/metrics -> Shows metrics for the otel-collector app
- localhost:1234/metrics -> All metrics collected by the collector (can take up to 10s because of prometheus rules in the otel-collector-config.yaml)
- localhost:9090/ -> Access prometheus for queries Prometheus can show you metrics from both the nodejs app (search for nodejs) and the otel-collector app (search for otel). This can take up to 10-12s because of the prometheus rule in the prometheus.yaml.
- otel-collector's prometheus receiver is still in development and does not support all prometheus features yet. (Read more)
- the location of the otel-collector config is a manual location set inside docker compose using 'command' in the otel-collector service. The default location is '/etc/otelcol-contrib/config.yaml'