热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Bearertokennotusedtoscrapetargets

Whathappened?bearerTokenFileparameternotusedwhenscrappingtar

What happened?
bearerTokenFile parameter not used when scrapping targets
Did you expect to see some different?
bearerTokenFile must be used in the authorization headers

How to reproduce it (as minimally and precisely as possible):
I followed the documentation here to deploy vault monitioring with prometheus - https://medium.com//yet-another-vault-monitoring-with-prometheus-blog-post-f525c862baca

  • Prometheus Operator version:

    1
    v0.31.1

    1
    quay.io/coreos/prometheus-operator:v0.31.1


  • Kubernetes version information:

    1
    kubectl version


1
2
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T12:38:36Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}

Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.10", GitCommit:"37d169313237cb4ceb2cc4bef300f2ae3053c1a2", GitTreeState:"clean", BuildDate:"2019-08-19T10:44:49Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}


  • Kubernetes cluster kind:

    kops + EC2


  • Manifests:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
apiVersion: monitoring.coreos.com/v1

kind: ServiceMonitor

metadata:

  labels:

    app.kubernetes.io/name: vault

  name: vault

spec:

  selector:

    matchLabels:

      app.kubernetes.io/name: vault

  endpoints:

    - interval: 30s

      path: /v1/sys/metrics

      params:

        format:

          - prometheus

      port: http

      scheme: http

      scrapeTimeout: 30s

      bearerTokenFile: /etc/prometheus/config_out/.vault-token


  • Prometheus Operator Logs:

I don't see any relevant logs for this issue

These are the logs I see in prometheus when I enable debug logging

1
2
level=debug ts=2019-11-18T17:56:54.883Z caller=scrape.go:920 component="scrape manager" scrape_pool=default/vault/0 target="http://172.18.27.231:8200/v1/sys/metrics?format=prometheus" msg="Scrape failed" err="server returned HTTP status 400 Bad Request"

level=debug ts=2019-11-18T17:57:09.189Z caller=scrape.go:920 component="scrape manager" scrape_pool=default/vault/0 target="http://172.18.23.16:8200/v1/sys/metrics?format=prometheus" msg="Scrape failed" err="server returned HTTP status 400 Bad Request"

该提问来源于开源项目:prometheus-operator/prometheus-operator

re-building the cluster seems to have fixed the issue


推荐阅读
author-avatar
DYongLi
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有