Adding Prometheus to the Compose network
We have set Prometheus up so that it is running successfully and also managed to monitor the Task Manager application. Since we added Prometheus to all of our applications, we should add it to the Compose file and parse the services.
Since Prometheus is interacting with the existing services, this is not an operation that should place from an external network. We should add a network that Prometheus will be able to operate. We will name it monitoring-network
:
networks: location-network: redis-network: monitoring-network:
Then, we should create the Prometheus configuration file. So far, we have introduced three services:
task-manager
location-service
events-service
Here, task-manager
and location-service
are on port 8080
. The configuration should look like this:
scrape_configs: - job_name: 'task-manager' scrape_interval: 1m...