This example uses Docker Compose to set up:
- A Python program that creates 5 instruments with 5 unique aggregators and a randomized load generator
- An instance of Cortex to recieve the metrics data
- An instance of Grafana to visualizse the exported data
- Have Docker Compose installed
Users do not need to install Python as the app will be run in the Docker Container
- Run
docker-compose up -d
in the theexamples/
directory
The -d
flag causes all services to run in detached mode and frees up your
terminal session. This also causes no logs to show up. Users can attach themselves to the service's logs manually using docker logs ${CONTAINER_ID} --follow
-
Log into the Grafana instance at http://localhost:3000
- login credentials are
username: admin
andpassword: admin
- There may be an additional screen on setting a new password. This can be skipped and is optional
- login credentials are
-
Navigate to the
Data Sources
page- Look for a gear icon on the left sidebar and select
Data Sources
- Look for a gear icon on the left sidebar and select
-
Add a new Prometheus Data Source
- Use
http://cortex:9009/api/prom
as the URL - (OPTIONAl) set the scrape interval to
2s
to make updates appear quickly - click
Save & Test
- Use
-
Go to
Metrics Explore
to query metrics- Look for a compass icon on the left sidebar
- click
Metrics
for a dropdown list of all the available metrics - (OPTIONAL) Adjust time range by clicking the
Last 6 hours
button on the upper right side of the graph - (OPTIONAL) Set up auto-refresh by selecting an option under the dropdown next to the refresh button on the upper right side of the graph
- Click the refresh button and data should show up on hte graph
-
Shutdown the services when finished
- Run
docker-compose down
in the examples directory
- Run