本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
利用以下部分来协助排查使用 Amazon Managed Service for Prometheus 时遇到的问题。
429 或超出限制错误
如果您看到类似于以下示例的 429 错误,则说明您的请求已超过 Amazon Managed Service for Prometheus 摄取配额。
ts=2020-10-29T15:34:41.845Z caller=dedupe.go:112 component=remote level=error remote_name=e13b0c url=http://iamproxy-external.prometheus.uswest2-prod.eks:9090/workspaces/
workspace_id
/api/v1/remote_write msg="non-recoverable error" count=500 err="server returned HTTP status 429 Too Many Requests: ingestion rate limit (6666.666666666667) exceeded while adding 499 samples and 0 metadata
如果您看到类似于以下示例的 429 错误,则说明您的请求已超过 Amazon Managed Service for Prometheus 配额,即工作区中活跃指标数量的配额。
ts=2020-11-05T12:40:33.375Z caller=dedupe.go:112 component=remote level=error remote_name=aps url=http://iamproxy-external.prometheus.uswest2-prod.eks:9090/workspaces/
workspace_id
/api/v1/remote_write msg="non-recoverable error" count=500 err="server returned HTTP status 429 Too Many Requests: user=accountid
_workspace_id
: per-user series limit (local limit: 0 global limit: 3000000 actual local limit: 500000) exceeded
如果您看到类似下面示例的 429 错误,则说明您的请求已超过 Amazon Managed Service for Prometheus 对使用与 Prometheus 兼容的 RemoteWrite
API 向工作区发送数据的速率(每秒事务数)的配额。
ts=2024-03-26T16:50:21.780708811Z caller=dedupe.go:112 component=remote level=error remote_name=ab123c url=https://aps-workspaces.us-east-1.amazonaws.com/workspaces/
workspace_id
/api/v1/remote_write msg="non-recoverable error" count=1000 exemplarCount=0 err="server returned HTTP status 429 Too Many Requests: {\"message\":\"Rate exceeded\"}"
如果您看到类似下面示例的 400 错误,则说明您的请求已超出 Amazon Managed Service for Prometheus 的活动时间序列配额。有关如何处理活动时间序列配额的详细信息,请参阅默认活跃系列。
ts=2024-03-26T16:50:21.780708811Z caller=push.go:53 level=warn url=https://aps-workspaces.us-east-1.amazonaws.com/workspaces/
workspace_id
/api/v1/remote_write msg="non-recoverable error" count=500 exemplarCount=0 err="server returned HTTP status 400 Bad Request: maxFailure (quorum) on a given error family, rpc error: code = Code(400) desc = addr=10.1.41.23:9095 state=ACTIVE zone=us-east-1a, rpc error: code = Code(400) desc = user=accountid
_workspace_id
: per-user series limit of 10000000 exceeded, Capacity from 2,000,000 to 10,000,000 is automatically adjusted based on the last 30 min of usage. If throttled above 10,000,000 or in case of incoming surges, please contact administrator to raise it. (local limit: 0 global limit: 10000000 actual local limit: 92879)"
有关 Amazon Managed Service for Prometheus 服务配额以及如何请求提升配额的更多信息,请参阅 Amazon Managed Service for Prometheus 服务配额
我看到重复的样本
如果您使用的是高可用性 Prometheus 组,则需要在 Prometheus 实例上使用外部标签来设置重复数据删除。有关更多信息,请参阅 对发送到 Amazon Managed Service for Prometheus 的高可用性指标进行重复数据删除。
有关复制数据的其他问题将在下一节讨论。
我看到关于样本时间戳的错误
Amazon Managed Service for Prometheus 按顺序摄取数据,并希望每个样本的时间戳都晚于前一个样本。
如果数据没有按顺序到达,则会出现以下错误:out-of-order
samples
、duplicate sample for timestamp
或 samples with
different value but same timestamp
。这些问题通常是由于向 Amazon Managed Service for Prometheus 发送数据的客户端设置不正确造成的。如果使用的是在代理模式下运行的 Prometheus 客户端,请检查配置中是否有系列名称重复或目标重复的规则。如果您的指标直接提供时间戳,请检查它们是否错乱。
有关其工作原理或检查设置方法的更多详细信息,请参阅 Prom Labs 的博客文章《了解 Prometheus 中的重复样本和 Out-of-order时间戳错误
我看到一条与限制相关的错误消息
注意
适用于 Prometheus 的亚马逊托管服务提供CloudWatch 使用率指标来监控 Prometheus 的资源使用情况。使用 CloudWatch使用情况指标警报功能,您可以监控 Prometheus 的资源和使用情况,以防止出现限制错误。
如果您看到以下错误消息之一,则可以请求增加其中一个 Amazon Managed Service for Prometheus 配额来解决问题。有关更多信息,请参阅 Amazon Managed Service for Prometheus 服务配额。
-
<value>
已超出每用户系列限制,请联系管理员提高该限制 -
<value>
已超出每指标系列的限制,请联系管理员提高 -
超过了摄取率限制(...)
-
系列有太多标签(...)系列: '%s'
-
查询时间范围超出限制(查询长度: xxx,限制: yyy)
-
查询在从摄取器获取组块时达到最大组块数限制
-
超出了限制。每个账户的最大工作区。
您的本地 Prometheus 服务器输出超出了限制。
Amazon Managed Service for Prometheus 为工作区可以从 Prometheus 服务器接收的数据量设定了服务配额。要查找您的 Prometheus 服务器向 Amazon Managed Service for Prometheus 发送的数据量,您可以在 Prometheus 服务器上运行以下查询。如果您发现自己的 Prometheus 输出超出了 Amazon Managed Service for Prometheus 的限制,则可以请求增加相应的服务配额。有关更多信息,请参阅 Amazon Managed Service for Prometheus 服务配额。
数据类型 | 要使用的查询 |
---|---|
当前活跃系列 |
|
当前摄取率 |
|
Most-to-least 每个指标名称的活动系列列表 |
|
每个指标系列的标签数 |
|
我的一些数据没有出现
由于各种原因,发送到 Amazon Managed Service for Prometheus 的数据可能会被丢弃。下表列出了数据可能被丢弃而不是被摄取的原因。
您可以使用 Amazon CloudWatch 跟踪丢弃数据的数量和原因。有关更多信息,请参阅 使用 CloudWatch 指标监控亚马逊托管服务的 Prometheus 资源。
Reason |
含义 |
---|---|
greater_than_max_sample_age |
丢弃比当前时间更早的日志行 |
new-value-for-timestamp |
发送重复样本的时间戳与之前记录的时间戳不同 |
per_metric_series_limit |
用户已达到每个指标活跃系列数上限 |
per_user_series_limit |
用户已达到活跃系列总数上限 |
rate_limited |
摄取率受限制 |
sample-out-of-order |
样本发送顺序混乱,无法处理 |
label_value_too_long |
标签值超过允许的字符限制 |
max_label_names_per_series |
用户已达到每个指标的标签名称数 |
missing_metric_name |
未提供指标名称 |
metric_name_invalid |
提供的指标名称无效 |
label_invalid |
提供的标签无效 |
duplicate_label_names |
提供的标签名称重复 |