grafana - Grafana:数据源(Prometheus)查询 403
问题描述
当从 grafana 查询数据源时,一些指标得到 403。
curl --location --request GET 'https://xxx.xxx.xxx/api/datasources/proxy/1/api/v1/query?query=sum(kube_pod_container_status_restarts_total%7Bnamespace%3D%22default%22%2C%20container%3D~%22al-agent-container%22%2C%20pod%3D%22al-agent-container-hlrz2%22%7D)&time=1607489911' \
> --header 'Accept: application/json' \
> --header 'Content-Type: application/json; charset=UTF-8' \
> --header 'Authorization: Bearer xxx' \
> --data-raw ''
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>
当使用相同的查询从 Prometheus 服务器端点查询时,它会解析为 200:
curl --location --request GET 'http://kube-system-prometheus-server.kube-system.svc.cluster.local/api/v1/query_range?query=sum(kube_pod_container_resource_requests_cpu_cores%7Bnamespace%3D%22default%22%2C%20pod%3D~%22al-agent-container-hlrz2%22%7D)&start=1607488035&end=1607489835&step=15' \
> --header 'Accept: application/json' \
> --header 'Content-Type: application/json; charset=UTF-8'
{"status":"success","data":{"resultType":"matrix","result":[]}}
Grafana 版本:v6.6.2 (3fa63cfc34)
Prometheus 没有任何身份验证,此问题仅针对少数指标而不是全部。
从其配置部分测试数据源时。它表明一切正常。
有人对此有任何想法吗?
解决方案
我发现了这个问题,
我在条目 LB 中启用了 WAF,我已删除并检查它是否有效。WAF 将其视为 SQL 注入并因此阻止它。
推荐阅读
- python - Pandas 动态条件格式
- java - 无法在 Oracle 氧气中运行文件
- python - 在 PySpark 中将向量列表转换为 DataFrame
- python - 使用 Tensorflow Keras 将 CNN 与 LSTM 相结合
- r - 将字符串拆分为多个固定宽度的列
- sparql - Sparql DBPedia 不返回 foaf:name 查询
- javascript - 使用请求库的 Firebase 函数未触发
- tensorflow - SSD-shufflenet-V2-FPN 比 Mobilenet V2 慢
- php - 从 URL 加载下一组结果 - PHP cURL
- webpack - 使用 Haul 时是否可以覆盖 AssetResolver 测试表达式?