docs/get-started/tutorials/prometheus-metrics.md
In this tutorial, you will learn how to set up Grafana to display Quickwit metrics using Prometheus. Grafana will visualize the metrics collected from Quickwit, allowing you to monitor its performance effectively.
First, create a docker-compose.yml file in your project directory. This file will configure and run Quickwit, Prometheus, and Grafana as Docker services.
Here’s the complete Docker Compose configuration:
services:
quickwit:
image: quickwit/quickwit
environment:
QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER: "true"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:7281"
ports:
- 7280:7280
command: ["run"]
grafana:
image: grafana/grafana-oss
container_name: grafana
ports:
- "${MAP_HOST_GRAFANA:-127.0.0.1}:3000:3000"
environment:
GF_INSTALL_PLUGINS: https://github.com/quickwit-oss/quickwit-datasource/releases/download/v0.4.6/quickwit-quickwit-datasource-0.4.6.zip;quickwit-quickwit-datasource
GF_AUTH_DISABLE_LOGIN_FORM: "true"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml # Ensure prometheus.yml exists in the same directory
ports:
- 9090:9090
7280./metrics endpoint.Prometheus needs a configuration file to define how it scrapes metrics from Quickwit. Create a file named prometheus.yml in the same directory as your Docker Compose file with the following content:
global:
scrape_interval: 1s
scrape_timeout: 1s
scrape_configs:
- job_name: quickwit
metrics_path: /metrics
static_configs:
- targets:
- quickwit:7280
Run the following command in your terminal to start all services defined in the Docker Compose file:
docker compose up
This will launch Quickwit, Prometheus, and Grafana services.
http://localhost:3000.http://prometheus:9090.Now that Grafana is set up with Prometheus as a data source, you can create custom dashboards or use Quickwit's pre-configured dashboards: