In this lab, you will become acquainted with Prometheus, set it up, and configure applications to collect metrics.
6 Points:
-
Learn About Prometheus:
- Begin by reading about Prometheus and its fundamental concepts:
-
Integration with Docker Compose:
- Expand your existing
docker-compose.yml
file from the previous lab to include Prometheus.
- Expand your existing
-
Prometheus Configuration:
- Configure Prometheus to collect metrics from both Loki and Prometheus containers.
-
Verify Prometheus Targets:
- Access
http://localhost:9090/targets
to ensure that Prometheus is correctly scraping metrics. - Capture screenshots that confirm the successful setup and place them in a file named
METRICS.md
within the monitoring folder.
- Access
4 Points:
-
Grafana Dashboards:
- Set up dashboards in Grafana for both Loki and Prometheus.
- You can use examples as references:
- Capture screenshots displaying your successful dashboard configurations and include them in
METRICS.md
.
-
Service Configuration Updates:
- Enhance the configuration of all services in the
docker-compose.yml
file:- Add log rotation mechanisms.
- Specify memory limits for containers.
- Ensure these changes are documented within your
METRICS.md
file.
- Enhance the configuration of all services in the
-
Metrics Gathering:
- Extend Prometheus to gather metrics from all services defined in the
docker-compose.yml
file.
- Extend Prometheus to gather metrics from all services defined in the
To Earn 2.5 Additional Points:
-
Application Metrics:
- Integrate metrics into your applications. You can refer to Python examples like:
-
Obtain Application Metrics:
- Configure your applications to export metrics.
-
METRICS.md Update:
- Document your progress with the bonus tasks, including screenshots, in the
METRICS.md
file.
- Document your progress with the bonus tasks, including screenshots, in the
-
Health Checks:
- Further enhance the
docker-compose.yml
file's service configurations by adding health checks for the containers.
- Further enhance the
- Maintain a well-structured and comprehensible
METRICS.md
document. - Adhere to file and folder naming conventions.
- Utilize code blocks and Markdown formatting where appropriate.
- Create pull requests (PRs) as needed: from your fork to the main branch of this repository, and from your fork's branch to your fork's master branch.
Note: Ensure thorough documentation of your work, and guarantee that Prometheus correctly collects metrics. Take advantage of the bonus tasks to deepen your understanding and enhance the completeness of your setup.