首页 > 解决方案 > AWS AMP:502 错误网关:无法代理请求 - WebIdentityErr:检索凭证失败

问题描述

我有 eks 设置并为 prometheus 提供了 aws 托管服务。创建了具有 AMP 完全访问权限(“aps:*”)的策略,并将该策略附加到 EKS 使用的角色。

Prometheus 安装在 eks 上,但无法将指标推送到 Prometheus 托管服务中。

EKS 在 VPC 中配置。

错误:

ts=2021-07-07T00:43:57.951Z caller=dedupe.go:112 component=remote level=warn remote_name=e595f3 url=http://localhost:8005/workspaces/ws-xxxx-xxxx-xxxx/api/ v1/remote_write msg="发送批处理失败,正在重试" err="服务器返回 HTTP 状态 502 错误网关:无法代理请求 - WebIdentityErr:检索凭据失败"

摄取政策:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "aps:*"
            ],
            "Resource": "*"
        }
    ]
}

信任关系:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::xxxxxx:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/65ETDGGHD56WTRSDGF"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "oidc.eks.us-east-1.amazonaws.com/id/65ETDGGHD56WTRSDGF:sub": "system:serviceaccount:test-eks-prometheus:amp-iamproxy-query-service-account"
        }
      }
    }
  ]
}

有什么帮助吗?

标签: amazon-web-servicesprometheusamazon-iamamazon-eks

解决方案


从“url=http://localhost:8005/workspaces/ws-xxxx-xxxx-xxxx/api/v1/remote_write”看来您正在尝试使用 sigv4 代理。Prometheus 现在原生支持 sigv4,我建议使用此设置删除一个组件以通过以下方式调试问题


推荐阅读