implementing a cooperative multi tenant capable
play

Implementing a Cooperative Multi-Tenant Capable Prometheus Users: - PowerPoint PPT Presentation

Jonas Groe Sundrup 10.08.2018 PromCon 2018 Implementing a Cooperative Multi-Tenant Capable Prometheus Users: run small-scale infrastructure arent monitoring experts 1 Target users Goal: Share monitoring infrastructure


  1. Jonas Große Sundrup 10.08.2018 PromCon 2018 Implementing a Cooperative Multi-Tenant Capable Prometheus

  2. Users: • run small-scale infrastructure • aren’t monitoring experts 1 Target users Goal: Share monitoring infrastructure

  3. low-resource monitoring/alerting Drop-dead-simple fjre-and-forget solution that just works 2 Goal

  4. 1. Prometheus 2. Alertmanager 3. System Architecture 4. Additional Services 3 Roadmap

  5. • One Prometheus per machine • Multi-tenancy • Ansible-compatibility • patch-free operation 4 Requirements

  6. Getting data into Prometheus

  7. 5 Deploying scrape targets ~/scrptarg ├── node1.yml ├── node2.yml ├── db.yml └── mail.yml

  8. 6 Deploying scrape targets - job_name: alice file_sd_configs: - files: ~/scrptarg - /home/alice/scrptarg/*.json ├── node1.yml - /home/alice/scrptarg/*.yml ├── node2.yml - /home/alice/scrptarg/*.yaml ├── db.yml refresh_interval: 5m └── mail.yml scheme: https basic_auth: username: prometheus password: <secret>

  9. 7 Deploying rules ~/rules ├── normal.yml └── the-apocalypse.yml

  10. Getting data out of Prometheus

  11. 8 up

  12. 9 up{job=“jonas”}

  13. 10 up{job=“jonas”}

  14. • your_metric{instance="mymachine"} • your_metric/my_metric{code="42"} • avg_over_time(your_metric[1h]) offset 1d 11 Injecting a label • your_metric{job="hello",instance="mybox"}

  15. • your_metric/my_metric{code="42"} • avg_over_time(your_metric[1h]) offset 1d 11 Injecting a label • your_metric{job="hello",instance="mybox"} • your_metric{instance="mymachine"}

  16. • avg_over_time(your_metric[1h]) offset 1d 11 Injecting a label • your_metric{job="hello",instance="mybox"} • your_metric{instance="mymachine"} • your_metric/my_metric{code="42"}

  17. 11 Injecting a label • your_metric{job="hello",instance="mybox"} • your_metric{instance="mymachine"} • your_metric/my_metric{code="42"} • avg_over_time(your_metric[1h]) offset 1d

  18. 12 A PromQL-parser

  19. 13 Retrieving Data in PromQL • sum( http_requests_total{code="200"} ) • avg_over_time( your_fancy_metric[1h] )

  20. 14 Rules rules: - alert: Endpoint down expr: up == 0 for: 10m annotations: summary: "Must be short, slide isn't wide"

  21. 15 Rules rules: - alert: jonas: Endpoint down expr: up{job="jonas"} == 0 for: 10m labels: job: jonas annotations: summary: "Must be short, slide isn't wide"

  22. Alertmanager

  23. 16 Alertmanager

  24. 17 Alertmanager

  25. 18 Silences

  26. 19 Architecture overview Blackbox- Exporter PAP Alert- PAP manager

  27. Blackbox-Exporter

  28. 20 Blackbox-Targets ~/blackboxtargets/ ├── http_2xx_ipv4 │ └── websites.yml └── tcp_connect_ipv6 └── tcp.yml

  29. 21 Blackbox-Exporter: Confjguration - job_name: jonas-blackbox-http_2xx-ipv4 params: module: - http_2xx_ipv4 metrics_path: /probe file_sd_configs: - files: - /home/jonas/blackbox/http_2xx_ipv4/*.json - /home/jonas/blackbox/http_2xx_ipv4/*.yml - /home/jonas/blackbox/http_2xx_ipv4/*.yaml refresh_interval: 5m relabel_configs: ...

  30. 22 Blackbox-Exporter: Relabelling relabel_configs: ... - target_label: job replacement: jonas action: replace ...

  31. 23 Blackbox-Exporter: Relabelling relabel_configs: ... - target_label: blackbox_module replacement: http_2xx action: replace - target_label: ip_version replacement: ipv4 action: replace

  32. • User separation: yes • low memory profjle: yes • Ansible-compatibility: yes • Alerting: yes • Ease of use: yes • No resource isolation • Only one set of target credentials • Preselected Featureset 24 Conclusion Limitations: Features:

  33. 25 jonas@grosse-sundrup.com https://github.com/cherti/promauthproxy

Recommend


More recommend