You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+220-3Lines changed: 220 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,11 +439,228 @@ npm run dev-font
439
439
```
440
440
441
441
442
-
# Message broker driver, possible values: rabbitmq, kafka, this is optional, if not exists or is empty, the Nayra will be work as normally with local execution
443
-
MESSAGE_BROKER_DRIVER=rabbitmq
442
+
# Install Prometheus and Grafana with Docker
443
+
444
+
This guide explains how to install and run **Prometheus** and **Grafana** using Docker. Both tools complement each other: Prometheus collects and monitors metrics, while Grafana visualizes them with interactive dashboards.
445
+
446
+
## Install Docker
447
+
Ensure Docker is installed on your system. Verify the installation:
448
+
```bash
449
+
docker --version
450
+
```
451
+
If not installed, follow the [official Docker documentation](https://docs.docker.com/get-docker/).
452
+
453
+
## Prometheus Installation
454
+
455
+
### 1. Pull the Prometheus Docker Image
456
+
Download the official Prometheus image from Docker Hub:
457
+
```bash
458
+
docker pull prom/prometheus
459
+
```
460
+
461
+
### 2. Create a Prometheus Configuration File
462
+
Prometheus requires a configuration file (`prometheus.yml`) to define the metrics it will collect. Example:
The compose file defines a stack with two services `prometheus` and `grafana`.
30
+
When deploying the stack, docker compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service.
31
+
Make sure the ports 9090 and 3000 on the host are not already in use.
32
+
33
+
## Deploy with docker compose
34
+
35
+
```
36
+
$ docker compose up -d
37
+
Creating network "prometheus-grafana_default" with the default driver
38
+
Creating volume "prometheus-grafana_prom_data" with default driver
39
+
...
40
+
Creating grafana ... done
41
+
Creating prometheus ... done
42
+
Attaching to prometheus, grafana
43
+
44
+
```
45
+
46
+
## Expected result
47
+
48
+
Listing containers must show two containers running and the port mapping as below:
49
+
```
50
+
$ docker ps
51
+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
52
+
dbdec637814f prom/prometheus "/bin/prometheus --c…" 8 minutes ago Up 8 minutes 0.0.0.0:9090->9090/tcp prometheus
53
+
79f667cb7dc2 grafana/grafana "/run.sh" 8 minutes ago Up 8 minutes 0.0.0.0:3000->3000/tcp grafana
54
+
```
55
+
56
+
Navigate to `http://localhost:3000` in your web browser and use the login credentials specified in the compose file to access Grafana. It is already configured with prometheus as the default datasource.
57
+
58
+
![page]
59
+
60
+
Navigate to `http://localhost:9090` in your web browser to access directly the web interface of prometheus.
61
+
62
+
Stop and remove the containers. Use `-v` to remove the volumes if looking to erase all data.
0 commit comments