matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Configuring external prometheus server to work with the playbook

Open roughnecks opened this issue 2 years ago • 0 comments

Playbook Configuration:

My vars.yml file looks like this:

# External Prometheus metrics
matrix_nginx_proxy_proxy_matrix_metrics_enabled: true
matrix_synapse_metrics_enabled: true
matrix_synapse_metrics_proxying_enabled: true
matrix_prometheus_node_exporter_enabled: true
matrix_prometheus_postgres_exporter_enabled: true
matrix_prometheus_node_exporter_metrics_proxying_enabled: true
matrix_prometheus_postgres_exporter_metrics_proxying_enabled: true

Matrix Server:

  • OS: Debian 11
  • Architecture amd64

Problem description:

I'm trying to use an external prometheus install on WSL Debian to get metrics from my ansible matrix HS. I have installed prometheus via apt repo and this is my prometheus.yml config file:

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

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  #external_labels:
      #monitor: 'example'

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets: ['myhsdomain.tld: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:
scrape_configs:

  - job_name: "node exporter"
    metrics_path: "/metrics/node-exporter"
    # when endpoint uses https:
    scheme: "https"

    scrape_interval: 15s
    scrape_timeout: 15s

    static_configs:
      - targets: ['myhsdomain.tld:9100']

  - job_name: "postgres exporter"
    metrics_path: "/metrics/postgres-exporter"
    # when endpoint uses https:
    scheme: "https"

    static_configs:
      - targets: ['myhsdomain.tld:9187']


  - job_name: "synapse"
    metrics_path: "/_synapse/metrics"
    # when endpoint uses https:
    scheme: "https"

    static_configs:
      - targets: ['myhsdomain.tld:9000']

What I get from prometheus is a "connection refused" for every job. Honestly I'm not sure whether my metrics_paths and ports are correct. Although I can say those ports on HS are "filtered" (nmapped them) but I have no firewall at all; I can't even see them listed as listening in netstat -lnp.

roughnecks avatar Jul 30 '22 16:07 roughnecks