Prometheus blackbox-exporter 没有连接到 Matomo

问题描述

我使用普罗米修斯来监控我的基础设施。但是 blackBox-exporter 无法从 matomo 获取信息,因此即使 matomo 已启动并运行,它也始终显示为停机。我似乎没有得到正确的请求

以下是我的 prometheus.yml 的一部分:

static_configs:
      - targets:
        - https://matomo.apps.test.osc.DOMAIN.com/index.PHP?module=API&method=API.getmatomoVersion&token_auth=MY_CORRECT_TOKEN
        - http://matomo.apps.rele.osc.DOMAIN.com
        - http://matomo.apps.prod.osc.DOMAIN.com
        - https://jira-test.DOMAIN.com
        - https://jira-rele.DOMAIN.com
        - https://jira-prod.DOMAIN.com
        - http://git-test.ads.DOMAIN.com
        - https://git-ext.ads.DOMAIN.com
        - http://git.ads.DOMAIN.com
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.10.10.4:9115  # The blackBox exporter's real hostname:port.

只有 matomo 不工作,jira 和 gitlab 工作正常。

我尝试了两种方式:只是 url 和 API 调用(见上文)。没有不同。我手动检查了 matomo 网址。

网址:http://localhost:9115/probe?target=https://matomo.apps.test.osc.DOMAIN.com/matomo.PHP&module=http_2xx

结果:

# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 0.0019091
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 1.2907564
# HELP probe_Failed_due_to_regex Indicates if probe Failed due to regex
# TYPE probe_Failed_due_to_regex gauge
probe_Failed_due_to_regex 0
# HELP probe_http_content_length Length of http content response
# TYPE probe_http_content_length gauge
probe_http_content_length 0
# HELP probe_http_duration_seconds Duration of http request by phase,summed over all redirects
# TYPE probe_http_duration_seconds gauge
probe_http_duration_seconds{phase="connect"} 0
probe_http_duration_seconds{phase="processing"} 0
probe_http_duration_seconds{phase="resolve"} 0.0019091
probe_http_duration_seconds{phase="tls"} 0
probe_http_duration_seconds{phase="transfer"} 0
# HELP probe_http_redirects The number of redirects
# TYPE probe_http_redirects gauge
probe_http_redirects 0
# HELP probe_http_ssl Indicates if SSL was used for the final redirect
# TYPE probe_http_ssl gauge
probe_http_ssl 0
# HELP probe_http_status_code Response HTTP status code
# TYPE probe_http_status_code gauge
probe_http_status_code 0
# HELP probe_http_uncompressed_body_length Length of uncompressed response body
# TYPE probe_http_uncompressed_body_length gauge
probe_http_uncompressed_body_length 0
# HELP probe_http_version Returns the version of HTTP of the probe response
# TYPE probe_http_version gauge
probe_http_version 0
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 2.466592019e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_success displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 0

使用比 matomo 提供的更多信息的正确结果(上图):

# HELP probe_dns_lookup_time_seconds Returns the time taken for probe dns lookup in seconds
# TYPE probe_dns_lookup_time_seconds gauge
probe_dns_lookup_time_seconds 0.0035209
# HELP probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE probe_duration_seconds gauge
probe_duration_seconds 0.159106
# HELP probe_Failed_due_to_regex Indicates if probe Failed due to regex
# TYPE probe_Failed_due_to_regex gauge
probe_Failed_due_to_regex 0
# HELP probe_http_content_length Length of http content response
# TYPE probe_http_content_length gauge
probe_http_content_length -1
# HELP probe_http_duration_seconds Duration of http request by phase,summed over all redirects
# TYPE probe_http_duration_seconds gauge
probe_http_duration_seconds{phase="connect"} 0.0323234
probe_http_duration_seconds{phase="processing"} 0.0619916
probe_http_duration_seconds{phase="resolve"} 0.0035209
probe_http_duration_seconds{phase="tls"} 0.0698657
probe_http_duration_seconds{phase="transfer"} 0.0233495
# HELP probe_http_redirects The number of redirects
# TYPE probe_http_redirects gauge
probe_http_redirects 0
# HELP probe_http_ssl Indicates if SSL was used for the final redirect
# TYPE probe_http_ssl gauge
probe_http_ssl 1
# HELP probe_http_status_code Response HTTP status code
# TYPE probe_http_status_code gauge
probe_http_status_code 200
# HELP probe_http_uncompressed_body_length Length of uncompressed response body
# TYPE probe_http_uncompressed_body_length gauge
probe_http_uncompressed_body_length 38116
# HELP probe_http_version Returns the version of HTTP of the probe response
# TYPE probe_http_version gauge
probe_http_version 1.1
# HELP probe_ip_addr_hash Specifies the hash of IP address. It's useful to detect if the IP address changes.
# TYPE probe_ip_addr_hash gauge
probe_ip_addr_hash 2.110796626e+09
# HELP probe_ip_protocol Specifies whether probe ip protocol is IP4 or IP6
# TYPE probe_ip_protocol gauge
probe_ip_protocol 4
# HELP probe_ssl_earliest_cert_expiry Returns earliest SSL cert expiry in unixtime
# TYPE probe_ssl_earliest_cert_expiry gauge
probe_ssl_earliest_cert_expiry 1.6475184e+09
# HELP probe_ssl_last_chain_expiry_timestamp_seconds Returns last SSL chain expiry in timestamp seconds
# TYPE probe_ssl_last_chain_expiry_timestamp_seconds gauge
probe_ssl_last_chain_expiry_timestamp_seconds 1.6475184e+09
# HELP probe_ssl_last_chain_info Contains SSL leaf certificate information
# TYPE probe_ssl_last_chain_info gauge
probe_ssl_last_chain_info{fingerprint_sha256="70c0ee5f7ce8f33461854a1abb327051c2440aa508c2c3b48be65413b664d623"} 1
# HELP probe_success displays whether or not the probe was a success
# TYPE probe_success gauge
probe_success 1
# HELP probe_tls_version_info Contains the TLS version used
# TYPE probe_tls_version_info gauge
probe_tls_version_info{version="TLS 1.3"} 1

我很感激任何帮助。谢谢各位。

编辑:

我进行了更多研究,发现我的容器无法与所有需要的系统进行通信。它可以与 https://jira-rele.DOMAIN.com 进行通信,没有任何问题,但对于其他人,我得到“无法访问主机”。

为什么会有不同,我如何让我的容器与我的所有系统进行通信?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)