Creating your first metrics query
We managed to submit our metrics to Prometheus, so now we can execute queries upon metrics. By having metric data, we can now create dashboards in Prometheus.
Let’s suppose we have lots of tasks created over time and we want to monitor them. To simulate the task creation, we will use the following script:
while true; do curl --location --request POST 'localhost:8080/task/' \ --header 'Content-Type: application/json' \ --data-raw '{ "id": "'$(date +%s%N)'", "name": "A task", "description": "A task that need to be executed at the timestamp specified", "timestamp": 1645275972000, "location": { "id": "1c2e2081-075d-443a-ac20-40bf3b320a6f", &...