当前位置: 首页 > 知识库问答 >
问题:

普罗米修斯适配器使用的正确的普罗米修斯URL是什么

邰勇军
2023-03-14
    null

使用默认配置和轻微的定制。

我可以访问prometheus、grafana和alertmanager,查询度量标准并查看精美的图表。

但是prometheus-adapter在启动时不断抱怨它不能访问/发现度量:

I0326 08:16:52.266095       1 adapter.go:98] successfully using in-cluster auth
I0326 08:16:52.330094       1 dynamic_serving_content.go:111] Loaded a new cert/key pair for "serving-cert::/var/run/serving-cert/tls.crt::/var/run/serving-cert/tls.key"
E0326 08:16:52.334710       1 provider.go:227] unable to update list of all metrics: unable to fetch metrics for query "{namespace!=\"\",__name__!~\"^container_.*\"}": bad_response: unknown response code 404
--prometheus-url=http://prometheus-operated.prom.svc:9090

--prometheus-url=http://prometheus-kube-prometheus-prometheus.prom.svc.cluster.local:9090                                                                                                                                                                                                              
$ kubectl -n prom get pods
NAME                                                     READY   STATUS    RESTARTS   AGE
alertmanager-prometheus-kube-prometheus-alertmanager-0   2/2     Running   0          16h
prometheus-adapter-76fcc79b7b-7xvrm                      1/1     Running   0          10m
prometheus-grafana-559b79b564-bh85n                      2/2     Running   0          16h
prometheus-kube-prometheus-operator-8556f58759-kl84l     1/1     Running   0          16h
prometheus-kube-state-metrics-6bfcd6f648-ms459           1/1     Running   0          16h
prometheus-prometheus-kube-prometheus-prometheus-0       2/2     Running   1          16h
prometheus-prometheus-node-exporter-2x6mt                1/1     Running   0          16h
prometheus-prometheus-node-exporter-bns9n                1/1     Running   0          16h
prometheus-prometheus-node-exporter-sbcjb                1/1     Running   0          16h

$ kubectl -n prom get services
NAME                                      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
alertmanager-operated                     ClusterIP   None           <none>        9093/TCP,9094/TCP,9094/UDP   16h
prometheus-adapter                        ClusterIP   10.0.144.45    <none>        443/TCP                      16h
prometheus-grafana                        ClusterIP   10.0.94.160    <none>        80/TCP                       16h
prometheus-kube-prometheus-alertmanager   ClusterIP   10.0.0.135     <none>        9093/TCP                     16h
prometheus-kube-prometheus-operator       ClusterIP   10.0.170.205   <none>        443/TCP                      16h
prometheus-kube-prometheus-prometheus     ClusterIP   10.0.250.223   <none>        9090/TCP                     16h
prometheus-kube-state-metrics             ClusterIP   10.0.135.215   <none>        8080/TCP                     16h
prometheus-operated                       ClusterIP   None           <none>        9090/TCP                     16h
prometheus-prometheus-node-exporter       ClusterIP   10.0.70.247    <none>        9100/TCP                     16h

kubectl -n kube-system get deployment/metrics-server
NAME             READY   UP-TO-DATE   AVAILABLE   AGE
metrics-server   1/1     1            1           15d
prometheus:
  url: http://prometheus-kube-prometheus-prometheus.prom.svc.cluster.local
certManager:
  enabled: true

在我的设置中,--prometheus-url对于prometheus-adapter的正确值是什么?

共有1个答案

爱亮
2023-03-14

该问题与用于通过入口暴露普罗米修斯的附加路径有关。

我在入口配置中使用了附加的路径前缀/monitory/prometheus/

解决办法是告诉普罗米修斯-适配器,普罗米修斯是可以访问的,包括。这个路径前缀。因此,以下内容让普罗米修斯-适配器感到高兴:

--prometheus-url=http://prometheus-kube-prometheus-prometheus.prom.svc.cluster.local:9090/monitoring/prometheus/
kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1
 类似资料:
  • 我将我的GKE API服务器升级到1.6,并正在将节点升级到1.6,但遇到了一个障碍... 我有一个prometheus服务器(版本1.5.2),运行在一个由Kubernetes部署管理的pod中,其中两个节点运行版本1.5.4Kubelet,一个新节点运行版本1.6。 但普罗米修斯仍然得到401。 更新:就像乔丹所说的kubernetes认证问题。在这里看到新的、更集中的问题;https://s

  • 我要监控的应用程序为健康检查提供了一个apiendpoint,该endpoint使用json中的指标进行响应。例如: 我已经设置了Prometheus blackbox\u exporter,以监视此endpoint是否返回200 Ok,但理想情况下,我也希望获得这些指标。我知道instrumentation直接从应用程序导出这些数据。但是,由于应用程序已经在导出json对象中我想要的内容,我更希

  • 摘要 由于导入的Grafana仪表板无法工作,我正在尝试找出如何在Prometheus查询中正确使用或运算符。

  • 我有一个启用了监视和日志记录的GKE集群(1.15)。到目前为止,我们一直使用metrics-server对StackDriver进行度量监控。对于其他自定义度量标准,我们使用了自定义度量标准适配器,该适配器使用Prometheus-to-SD将度量标准刮取并导出到stackdriver。 我想开始看看prometheus是否能给我们提供其他功能,比如HPA的聚合度量。 在GCP marketpl

  • 关于整合齐普金和普罗米修斯的可能性的小问题。 目前,我们已经有了一个完全可用的Zipkin实例,以及它的web UI。Zipkin超级酷,一切都很好。 我们能够让所有微服务向Zipkin发送跟踪信息,并让Zipkin汇总这些信息。 我们还可以在UI中搜索痕迹等等,超级酷。 另一方面,我们也有一个非常成熟的经过实战检验的Prometheus Grafana,其中已经包含了容器级指标、应用程序级指标和

  • 我使用Spring-Boot2.0.0并尝试公开/acturet/prometheusendpoint。我启用了所有web管理endpoint,但只有prometheusendpoint未公开。有什么帮助吗?