Amazon Managed Service for Prometheus
Synopsis
Creates an Amazon Managed Service for Prometheus target that sends metrics to a workspace with remote-write.
It is the Prometheus remote-write target with AWS's sign-in and limits built in. That page describes what the Prometheus targets have in common: what is sent, names and labels, counts over an interval, and the receiver's answers. This page covers only what differs.
Schema
- name: <string>
description: <string>
type: amazonprometheus
pipelines: <pipeline[]>
status: <boolean>
properties:
url: <string>
region: <string>
key: <string>
secret: <string>
session: <string>
timeout: <numeric>
batch_size: <numeric>
max_retries: <numeric>
retry_delay: <numeric>
disable_retries: <boolean>
debug:
status: <boolean>
dont_send_logs: <boolean>
Configuration
The following fields are used to define the target:
| Field | Required | Default | Description |
|---|---|---|---|
name | Y | Target name | |
description | N | - | Optional description |
type | Y | Must be amazonprometheus | |
pipelines | N | - | Optional post-processor pipelines |
status | N | true | Enable/disable the target |
Connection
| Field | Required | Default | Description |
|---|---|---|---|
url | Y | - | The workspace's remote-write endpoint, https://aps-workspaces.<region>.amazonaws.com/workspaces/<workspace-id>/api/v1/remote_write. The workspace's details in the AWS console show it. It must use https. In the console: |
region | N | - | The AWS region of the workspace. The target reads it from the URL. Set it when the URL does not name it, such as a private endpoint. In the console: |
AWS Credentials
| Field | Required | Default | Description |
|---|---|---|---|
key | N | - | The access key ID. Set it with secret. In the console: |
secret | N | - | The secret access key. Set it with key. In the console: |
session | N | - | The session token of temporary credentials. It is used only with key and secret. In the console: |
key, secret and session can each be plain text, an environment variable or a secret. Leave out key and secret to sign with the credentials of the host (see Credentials).
Performance
| Field | Required | Default | Description |
|---|---|---|---|
timeout | N | 30 | As on the Prometheus remote-write page |
batch_size | N | 1000 | As on the Prometheus remote-write page. A request that would be over 1 MB is split (see Request Size) |
max_retries | N | 3 | As on the Prometheus remote-write page |
retry_delay | N | 1 | As on the Prometheus remote-write page |
disable_retries | N | false | As on the Prometheus remote-write page |
Scheduling
See Scheduling and Pool Behavior for interval and cron fields shared by all targets.
Debug Options
The debug options work as on the OTLP page.
Settings That Do Not Apply
The target signs each request itself, so it ignores username, password and token, and its signature replaces an Authorization header set under headers. It also ignores the settings listed on the Prometheus remote-write page.
The Console Form
The form has one step,
Remote-write URL andRegion (Optional).Credentials , which is Host's role (the default) or Access key. Access key showsAccess key ID andSecret access key , both required, andSession token (Optional). The secret access key has the Manual / Environment variable / Vault picker.- The Performance fields.
The Credentials choice belongs to the form, not to the YAML. Host's role sends no credentials, and Access key sends the key fields. The form has no TLS step, because AWS's endpoints use public certificates.
Details
Sign-in
The target signs each request with AWS Signature Version 4 for the service aps. The identity needs the aps:RemoteWrite permission on the workspace.
Credentials
Two ways:
- An access key: set
keyandsecret, andsessionfor temporary credentials. The target reads them when it starts, and it does not renew a session token when the token expires. - The credentials of the host: leave out
keyandsecret. The target then finds credentials the same way the AWS SDK does. It checks the environment, then a shared profile, then the role of the host, such as an EC2 instance profile or an EKS service account role.
For temporary credentials, use the role of the host, or a shared profile that assumes a role, signs in with IAM Identity Center or runs a credential process. The AWS SDK renews these. A profile that holds temporary keys copied into it must be updated when they expire.
A key, a secret or a session token that is set but resolves to nothing stops the target from starting. So an empty secret never makes the target sign as the host by mistake.
Request Size
AWS refuses a request over 1 MB. The target splits a request that would be larger, between two records. A single record over the limit by itself is dropped and counted as dropped, with a warning in the Director log.
The Workspace's Limits
AWS limits each workspace, for example its active series and its samples per second. Over the ingestion rate, AWS refuses the whole request, and the target retries it. AWS also refuses samples older than one hour. The workspace's quotas are on the Service Quotas page of the AWS console.
Everything Else
Everything else works as on the Prometheus remote-write page.
Examples
The Role of the Host
Sending with the role of the host... | |
An Access Key
An access key, with its secret from a secret store... | |
A Private Endpoint
A private endpoint whose address does not name the region... | |
Troubleshooting
Configuration Errors
Director refuses a configuration it cannot use, with one of these messages:
url is required for Amazon Managed Service for Prometheusurl for Amazon Managed Service for Prometheus must be an https URL with a host, such as https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-12345678/api/v1/remote_writeregion is required for Amazon Managed Service for Prometheus: the url does not name its region, so set region, for example eu-west-1set both key and secret, or neitherthe secret of the Amazon Managed Service for Prometheus target resolved to nothing: check the environment variable or the secret it names: the setting is set, but its environment variable or secret is empty. The same message names the key or the session token.failed to resolve the key of the Amazon Managed Service for Prometheus target: ...: the environment variable or the secret could not be read.no AWS credentials to sign the requests with: set key and secret, or give the host an AWS role
Errors While It Runs
[OTLP] sign-error ...: the target could not get AWS credentials to sign the request, for example because the host has no AWS role. The target retries, and the batches are delivered again once this is fixed.status 403: the identity lacksaps:RemoteWrite,regiondoes not match the workspace, or the credentials expired, such as a session token set by hand. The batches are delivered again once this is fixed.status 404: the workspace ID or the path inurlis wrong.status 429: the workspace is over its ingestion rate. The target retries.[OTLP] dropped a record of N bytes: Amazon Managed Service for Prometheus refuses a request over 1000000 bytes: a single record was too large to send.- The warnings of the Prometheus remote-write page apply too.