Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Autodiscover clients in Prometheus formula in Uyuni 2020.03 #2082

Closed
bpetru opened this issue Mar 31, 2020 · 14 comments
Closed

Enable Autodiscover clients in Prometheus formula in Uyuni 2020.03 #2082

bpetru opened this issue Mar 31, 2020 · 14 comments
Labels
bug Something isn't working

Comments

@bpetru
Copy link

bpetru commented Mar 31, 2020

Hi,
I try to configure monitoring with Prometheus, but after I activate Autodiscover clients in salt formula the Prometheus server dose not start.

The error is:
--config.file=\"/etc/prometheus/prometheus.yml\"): parsing YAML file /etc/prometheus/prometheus.yml: yaml: unmarshal errors:\n line 36: field uyuni_sd_configs not found in type config.plain" (--config.file=\"/etc/prometheus/prometheus.yml\"): parsing YAML file /etc/prometheus/prometheus.yml: yaml: unmarshal errors:\n line 36: field uyuni_sd_configs not found in type config.plain"

If I disable Autodiscover the server works ok, and I have Uyuni performance data.

@paususe
Copy link
Contributor

paususe commented Apr 1, 2020

@cavalheiro @renner
Could you please take a look?

@srbarrios
Copy link
Member

srbarrios commented Apr 2, 2020

Might it just be an indentation issue?
This is the example from the doc, but it might be wrong?

# Managed systems metrics:
- job_name: 'mgr-clients'
  uyuni_sd_configs:
   - host: "http://server.url"
     username: "admin"
     password: "admin"

@calancha
Copy link
Contributor

calancha commented Apr 2, 2020

Using the following configuration (that is, I keep the wrong indentation), it works:

# Sample config for Prometheus.

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.
  evaluation_interval: 15s # By default, scrape targets every 15 seconds.
  # 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'

# Load and evaluate rules in this file every 'evaluation_interval' seconds.
rule_files:
  # - "first.rules"
  # - "second.rules"

# {productname} self-health metrics
scrape_configs:
- job_name: 'mgr-server'
  static_configs:
    - targets:
      - 'vm153088.qa.prv.suse.net:9100'  # Node exporter
      - 'vm153088.qa.prv.suse.net:9187'  # PostgreSQL exporter
      - 'vm153088.qa.prv.suse.net:5556'  # JMX exporter (Tomcat)
      - 'vm153088.qa.prv.suse.net:5557'  # JMX exporter (Taskomatic)
      - 'vm153088.qa.prv.suse.net:9800'  # Taskomatic
    - targets:
      - 'vm153088.qa.prv.suse.net:80'    # Message queue
      labels:
        __metrics_path__: /rhn/metrics

# Managed systems metrics:
- job_name: 'mgr-clients'
  uyuni_sd_configs:
   - host: "http://vm153088.qa.prv.suse.net"
     username: "admin"
     password: "admin"

Here, the SUMA server is the one for testing beta 2, and the monitoring client is a sles15sp2.

@calancha
Copy link
Contributor

calancha commented Apr 2, 2020

Screenshot of restart service after apply config. above:
Screenshot from 2020-04-02 11-08-34

@calancha
Copy link
Contributor

calancha commented Apr 2, 2020

Prometheus endpoint after restart service w/ above config.:
Screenshot from 2020-04-02 11-09-39

@cavalheiro
Copy link
Contributor

@mateiw can you take a look at this please?

@mateiw
Copy link
Contributor

mateiw commented Apr 8, 2020

I couldn't reproduce the issue. It works fine for me.
@bpetru could you please post a screenshot of the Prometheus formula and the content of the /etc/prometheus/prometheus.yml file ?

@willianops
Copy link

willianops commented Oct 30, 2020

Man, I have the same problem.. but indetation don't work for me..

error:

promtool check config prometheus.yml

Checking prometheus.yml
FAILED: parsing YAML file prometheus.yml: yaml: unmarshal errors:
line 44: field uyuni_sd_configs not found in type config.plain

Config:

global:
scrape_interval: 15s
evaluation_interval: 15s

Alertmanager configuration

alerting:
alertmanagers:

  • static_configs:
    • targets:
      • localhost:9093

rule_files:

  • /etc/prometheus/rules/general-rules.yml
  • /etc/prometheus/rules/prometheus-rules.yml

Scrape configurations

scrape_configs:

--------------------

Monitor 001.xxx.net

--------------------

  • job_name: 'mgr-server'
    static_configs:
    • targets:
      • 001.xxx.net:9100 # Node exporter
      • 001.xxx.net:5556 # Tomcat JMX
      • 001.xxx.net:5557 # Taskomatic JMX
      • 001.xxx.net:9800 # Uyuni server exporter
        labels: {}
    • targets:
      • 001.xxx.net:80 # Message queue
        labels:
        metrics_path: /rhn/metrics
    • targets:
      • 001.xxx.net:9187 # PostgresSQL
        labels:
        role: postgres

--------------------

Auto discover clients of 001.xxx.net

--------------------

  • job_name: 'mgr-clients'
    uyuni_sd_configs:

--------------------

Metamonitoring

--------------------

  • job_name: prometheus
    static_configs:
    • targets:
      • 008.net:9090

@cavalheiro
Copy link
Contributor

@willianops which Prometheus package are you using?
For service discovery to work correctly, you have to use the package provided in the Uyuni client tools channel.

@willianops
Copy link

Uyuni

I'm use Suse Manager to deploy configurations of prometheus. All configs are native and default . Of Course Suse Manager using Uyuni in background. by the way, I opened a Case in Suse Support

@mcalmer mcalmer added the bug Something isn't working label Dec 12, 2020
@noelmcloughlin
Copy link

you have to use the package provided in the Uyuni client tools channel.

Hi, I help maintain prometheus-formula and this issue is logged there too.
saltstack-formulas/prometheus-formula#47
What is the Uyuni client tools channel and should promethtus-formula support that source? (since we aim to be comprehensive).

@aaannz
Copy link
Contributor

aaannz commented Oct 12, 2021

@witekest If you will have time, can you take a look at this if it is still valid and possibly close the issue?

@witekest
Copy link
Contributor

you have to use the package provided in the Uyuni client tools channel.

Hi, I help maintain prometheus-formula and this issue is logged there too. saltstack-formulas/prometheus-formula#47 What is the Uyuni client tools channel and should promethtus-formula support that source? (since we aim to be comprehensive).

Uyuni service discovery is still not available in upstream Prometheus. Uyuni client tools is the repository providing the forked Prometheus with Uyuni SD. After prometheus/prometheus#8190 gets accepted, the problem should be solved.

@aaannz
Copy link
Contributor

aaannz commented Oct 26, 2021

Upstream PR merged, this issue should be solved now. Closing issue.

@aaannz aaannz closed this as completed Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests