Member-only story
Docker Scout Sample Project — Prometheus
This is describes how to scrape the metrics endpoint using Prometheus.
🌟 Add a job for your organization:
In the Prometheus configuration file, add a new job for your organization. The job should include the following configuration; replace ORG
with your organization name:
scrape_configs:
- job_name: ORG
metrics_path: /v1/exporter/org/ORG/metrics
scheme: https
static_configs:
- targets:
- api.scout.docker.com
The address in the targets
field is set to the domain name of the Docker Scout API, api.scout.docker.com
. Make sure that there's no firewall rule in place preventing the server from communicating with this endpoint.
🌟 Add bearer token authentication:
To scrape metrics from the Docker Scout Exporter endpoint using Prometheus, you need to configure Prometheus to use the PAT as a bearer token. The exporter requires the PAT to be passed in the Authorization
header of the request.
Update the Prometheus configuration file to include the authorization
configuration block. This block defines the PAT as a bearer token stored in a file:
scrape_configs:
- job_name: $ORG
authorization:
type: Bearer
credentials_file: /etc/prometheus/token
The content of the file should be the PAT in plain text:
dckr_pat_...