我有ASP.NET应用程序接口应用程序,我想将这些数据用于普罗米修斯。
我的API链接,它返回Json数据https://localhost:44361/api/Authors
目前,我一直在配置prometheus.yml,我添加了scheme、metrics_path、更改了targets,但在我单击http://localhost:9090/targets endpoint https://localhost:44361/api/authors后得到的结果是
https://desktop-5lf9021:44361/api/authors,则错误消息为
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.# my global config
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
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
scheme: https
metrics_path: '/api/authors'
static_configs:
- targets: ['localhost:44361']如何获取正确的数据?
发布于 2020-01-25 17:00:41
错误请求-主机名无效错误400。请求主机名无效。
这是您的应用程序的一个问题,您可能需要修复它以忽略这些请求的Host头。
https://stackoverflow.com/questions/59896487
复制相似问题