|
|
||
|---|---|---|
| .. | ||
| Dockerfile | ||
| README.md | ||
| cortex-config.yml | ||
| docker-compose.yml | ||
| requirements.txt | ||
| sampleapp.py | ||
README.md
Prometheus Remote Write Exporter Example
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 receive the metrics data
- An instance of Grafana to visualizse the exported data
Requirements
- Have Docker Compose installed
Users do not need to install Python as the app will be run in the Docker Container
Instructions
- Run
docker-compose up -din 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: adminandpassword: 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 Sourcespage- 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/promas the URL - (OPTIONAl) set the scrape interval to
2sto make updates appear quickly - click
Save & Test
- Use
-
Go to
Metrics Exploreto query metrics- Look for a compass icon on the left sidebar
- click
Metricsfor a dropdown list of all the available metrics - (OPTIONAL) Adjust time range by clicking the
Last 6 hoursbutton 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 the graph
-
Shutdown the services when finished
- Run
docker-compose downin the examples directory
- Run