We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Prometheus

Prometheus is a popular open-source monitoring and alerting toolkit. It provides a time-series database for metrics, an API for querying them, and the ability to gather metrics from many sources, such as your applications and operating systems.

We'll install Prometheus and configure Linko to export Prometheus metrics. We'll also set up Grafana to visualize the data Prometheus gathers, but more on that shortly.

Click to play video

Assignment

Let's install Prometheus.

  1. services:
      prometheus:
        image: prom/prometheus:latest
        ports:
          - "9090:9090"
        volumes:
          - ./prometheus.yml:/etc/prometheus/prometheus.yml
    
  2. global:
      scrape_interval: 1s
    
    scrape_configs:
      - job_name: prometheus
        static_configs:
          - targets: ["localhost:9090"]
    

    We use 1s here to make scraping easy to observe during development and testing. That's usually too aggressive for production. A more typical interval is 15s-60s depending on scale and cost constraints.

  3. docker compose up
    

Run and submit the CLI tests from the root of the Linko repo.