Querying Prometheus metrics via API and Grafana
You can use the Prometheus-compatible API and Grafana to query the metrics ingested to Prometheus. Let’s look at how to do it in the following sections.
Querying Prometheus metrics using Prometheus APIs
To query AMP using the Prometheus-compatible APIs, you need to sign your requests using the AWS Signature Version 4 process (see https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). You can accomplish this requirement in many different ways, and between them, you can use a proxy such as the AWS Sig4 Proxy (see https://github.com/awslabs/aws-sigv4-proxy) or use the awscurl
tool (see https://github.com/okigan/awscurl). In this section, we will use the awscurl
tool.
So, let’s get started with querying AMP using the Prometheus-compatible APIs:
- On your Cloud9 shell, execute the following command to install the
awscurl
tool:$ pip3 install awscurl
- To execute requests, you need the Prometheus...