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
-
Pull Request to Forked Repository:
- Create a Pull Request (PR) to the main branch of the forked repository.
- Request your teammates to review this PR, and actively review PRs from your teammates.
-
Pull Request in Your Repository:
- Construct a PR in your repository, linking the lab8 branch to the main branch.
- This step is essential for grading and monitoring your work.
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
Guidelines:
- Maintain a well-structured and comprehensible
METRICS.md
document. - Adhere to file and folder naming conventions.
- Utilize code blocks and Markdown formatting where appropriate.
- Engage actively in the peer review process by submitting and reviewing PRs.
- When creating the PR in your repository, make it from the lab4 branch to the lab3 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.