public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup v7 0/8] add metrics server capability
@ 2022-06-02 12:18 Dominik Csapak
  2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 1/8] use 'fs_info' from proxmox-sys Dominik Csapak
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Dominik Csapak @ 2022-06-02 12:18 UTC (permalink / raw)
  To: pbs-devel

this series adds support for exporting metrics data to external
metric servers.

for now this includes only data we gather for RRD, though it should
not be hard to extend that functionality

also only influxdb (udp/http(s)) is currently supported, but it should
also not be too hard to include more options here

proxmox-backup depends on bumped versions of the proxmox-* crates

changes from v5/6:
* rebased on master

changes from v4:
* rebase on master
* move connect_to_udp to udp::connect(), and let it really try every address
* adds 'test_influxdb_http/udp' functions that try to connect for some
  sanity checks. (needed a little refactor in the http/udp parts but
  mostly code move)
* checks the server connection on create/edit via api when the enable
  flag is set
* adds a generic 'list' api call in /admin/metricserver since we need
  a place where we return *all* metrics servers regardless of type
  (and this is the way we do it e.g. for realms)
* adds the gui to view/add/edit/delete the metric servers
  (i put it under configuration, but that gets crowded... maybe there
  is a better place?)

changes from v3:
* rebase on master
* introduced helper functions instead of InfluxDBHttp::new
* start tokio task directly in the helper
* combine channel close + join
* fix api description
* combine host/port/protocol in the api types
* introduce a connect_to_udp helper
* use NixPath in the fs_info helper

changes from v2:
* rebase on master
* rustfmt
* clippy (fixed not everything)
* renamed DiskUsage in proxmox-sys and added some more fields
* added 'enable' property for the config (like we have in pve)
* subtracted 50bytes from mtu in the udp variant (for ip header)

changes from v1:
* fixed ipv6 support for udp (tested it this time ;) )
* dropped the 'flush' functionality of the MetricsChannel, but kept the
  wrapper struct: it did not do what i intended, and after rethinking it,
  turns out it's not necessary (as we autoflush when the data gets to large,
  or when we close the channel). kept the struct so that the interface
  can stay the same even if we want to implement a manual flush in the future
* improved the influxdb line formatter
* removed variables like 'names2' by reorganizing the code
* used Arc::clone(&foo) instead of foo.clone() (better visibilty)
* used CamelCase for the DeletableProperties

Dominik Csapak (8):
  use 'fs_info' from proxmox-sys
  pbs-api-types: add metrics api types
  pbs-config: add metrics config class
  backup-proxy: decouple stats gathering from rrd update
  proxmox-backup-proxy: send metrics to configured metrics server
  api: add metricserver endpoints
  ui: add window/InfluxDbEdit
  ui: add MetricServerView and use it

 Cargo.toml                                   |   1 +
 pbs-api-types/src/lib.rs                     |  17 +
 pbs-api-types/src/metrics.rs                 | 138 ++++++++
 pbs-config/Cargo.toml                        |   1 +
 pbs-config/src/lib.rs                        |   1 +
 pbs-config/src/metrics.rs                    | 115 +++++++
 src/api2/admin/datastore.rs                  |   4 +-
 src/api2/admin/metricserver.rs               |  91 +++++
 src/api2/admin/mod.rs                        |   2 +
 src/api2/config/metricserver/influxdbhttp.rs | 314 +++++++++++++++++
 src/api2/config/metricserver/influxdbudp.rs  | 269 +++++++++++++++
 src/api2/config/metricserver/mod.rs          |  16 +
 src/api2/config/mod.rs                       |   2 +
 src/api2/node/status.rs                      |  13 +-
 src/api2/status.rs                           |   4 +-
 src/bin/proxmox-backup-proxy.rs              | 336 +++++++++++++++----
 src/tools/disks/mod.rs                       |  20 +-
 www/Makefile                                 |   2 +
 www/NavigationTree.js                        |   6 +
 www/config/MetricServerView.js               | 145 ++++++++
 www/window/InfluxDbEdit.js                   | 218 ++++++++++++
 21 files changed, 1617 insertions(+), 98 deletions(-)
 create mode 100644 pbs-api-types/src/metrics.rs
 create mode 100644 pbs-config/src/metrics.rs
 create mode 100644 src/api2/admin/metricserver.rs
 create mode 100644 src/api2/config/metricserver/influxdbhttp.rs
 create mode 100644 src/api2/config/metricserver/influxdbudp.rs
 create mode 100644 src/api2/config/metricserver/mod.rs
 create mode 100644 www/config/MetricServerView.js
 create mode 100644 www/window/InfluxDbEdit.js

-- 
2.30.2





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-06-08  8:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 12:18 [pbs-devel] [PATCH proxmox-backup v7 0/8] add metrics server capability Dominik Csapak
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 1/8] use 'fs_info' from proxmox-sys Dominik Csapak
2022-06-07  6:51   ` [pbs-devel] applied: " Thomas Lamprecht
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 2/8] pbs-api-types: add metrics api types Dominik Csapak
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 3/8] pbs-config: add metrics config class Dominik Csapak
2022-06-03 10:16   ` Wolfgang Bumiller
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 4/8] backup-proxy: decouple stats gathering from rrd update Dominik Csapak
2022-06-02 14:09   ` Matthias Heiserer
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 5/8] proxmox-backup-proxy: send metrics to configured metrics server Dominik Csapak
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 6/8] api: add metricserver endpoints Dominik Csapak
2022-06-07 12:44   ` Thomas Lamprecht
2022-06-08  8:23     ` Dominik Csapak
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 7/8] ui: add window/InfluxDbEdit Dominik Csapak
2022-06-02 12:18 ` [pbs-devel] [PATCH proxmox-backup v7 8/8] ui: add MetricServerView and use it Dominik Csapak
2022-06-07 12:55   ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal