Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在prometheus配置文件中指定完整URL?_Prometheus - Fatal编程技术网

如何在prometheus配置文件中指定完整URL?

如何在prometheus配置文件中指定完整URL?,prometheus,Prometheus,我想监控一个使用apache tomact 8部署的应用程序,例如url是hostip:port/login.jsp,但在prometheus配置文件中,我们只能提到hostip:port,我可以在其中指定额外的login.jsp路径,以便它监控特定的应用程序 我已经尝试更改mertic_路径,但遇到了一些无效的令牌错误 配置文件: global: scrape_interval: 15s # Set the scrape interval to every 15 seconds.

我想监控一个使用apache tomact 8部署的应用程序,例如url是hostip:port/login.jsp,但在prometheus配置文件中,我们只能提到hostip:port,我可以在其中指定额外的login.jsp路径,以便它监控特定的应用程序

我已经尝试更改mertic_路径,但遇到了一些无效的令牌错误

配置文件:

global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

rule_files:
  - 'promrules.yml'


scrape_configs:
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'bank'
    #metrics_path: /login.jsp
    static_configs:
    - targets: ['<hostip>:<port>']
全球:
刮水间隔:15s#将刮水间隔设置为每15秒一次。默认值为每1分钟一次。
评估间隔:15s#每15秒评估一次规则。默认值为每1分钟一次。
#刮削超时设置为全局默认值(10秒)。
#Alertmanager配置
提醒:
警报管理员:
-静态\u配置:
-目标:
#-alertmanager:9093
规则文件:
-“promrules.yml”
刮取_配置:
-工作名称:“普罗米修斯”
#metrics\u路径默认为“/metrics”
#方案默认为“http”。
静态\u配置:
-目标:['localhost:9090']
-工作名称:“银行”
#度量\u路径:/login.jsp
静态\u配置:
-目标:[':']

使用
metrics\u path
的最小示例配置如下所示:

- job_name: my-service
  metrics_path: "/custom-metrics-endpoint"
  static_configs:
    - targets:
      - localhost:9090

如果遇到yaml解析错误,请在路径周围使用引号。

你好,奥利弗,问题不在于我能够使用的度量路径,而是它给出了“不是有效的令牌错误”。您使用的是什么版本的普罗米修斯?仅供参考,上述配置代码片段已确认可用于Prometheus 2.10.0此格式适用于我
metrics\u path
将允许您提及您公开Prometheus metrics@Tejas的路径