From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox/proxmox-backup v9] add metrics server capability
Date: Fri, 10 Jun 2022 13:17:49 +0200 [thread overview]
Message-ID: <20220610111757.2788694-1-d.csapak@proxmox.com> (raw)
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
i changed the interface of send_data_to_channels, so we'd need
to bump proxmox-metrics once and add the updated dependency
changes from v8:
* changed the send_data_to_channels interface slightly
* changed the interface in get_metric_server_connections
to Vec<(Metrics, String), instead of (Vec<Metrics>, Vec<String>)
* used updater in api type for enable, so that we have a bool instead
of an Option<bool>
* do 'const *_SCHEMA: &ObjectSchema' in config
* fixed a small bug in the ui (not noticable without the
dev console open), where we'd try to load and set data into the edit window
when adding a new metric server
changes from v7:
* rebase on master
* changes api paths from 'metricserver' to 'metrics'
* moved gui option to configuration (instead of top-level)
* moved metricserver type/xtype definition to 'PBS.Schema'
* incorporated wolfgangs feedback for the config
(unwrap_object_schema; unwrap_or_default)
* incorporated matthias feedback (dropped unnecessary borrows)
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
proxmox:
Dominik Csapak (1):
proxmox-metrics: send_data_to_channels: change from slice to
IntoIterator
proxmox-metrics/src/lib.rs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
proxmox-backup:
Dominik Csapak (7):
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 | 148 ++++++++++
pbs-config/Cargo.toml | 1 +
pbs-config/src/lib.rs | 1 +
pbs-config/src/metrics.rs | 105 ++++++++
src/api2/admin/metrics.rs | 91 +++++++
src/api2/admin/mod.rs | 2 +
src/api2/config/metrics/influxdbhttp.rs | 315 ++++++++++++++++++++++
src/api2/config/metrics/influxdbudp.rs | 270 +++++++++++++++++++
src/api2/config/metrics/mod.rs | 16 ++
src/api2/config/mod.rs | 2 +
src/bin/proxmox-backup-proxy.rs | 342 +++++++++++++++++++-----
www/Makefile | 3 +
www/Schema.js | 15 ++
www/SystemConfiguration.js | 6 +
www/config/MetricServerView.js | 128 +++++++++
www/window/InfluxDbEdit.js | 218 +++++++++++++++
18 files changed, 1610 insertions(+), 71 deletions(-)
create mode 100644 pbs-api-types/src/metrics.rs
create mode 100644 pbs-config/src/metrics.rs
create mode 100644 src/api2/admin/metrics.rs
create mode 100644 src/api2/config/metrics/influxdbhttp.rs
create mode 100644 src/api2/config/metrics/influxdbudp.rs
create mode 100644 src/api2/config/metrics/mod.rs
create mode 100644 www/Schema.js
create mode 100644 www/config/MetricServerView.js
create mode 100644 www/window/InfluxDbEdit.js
--
2.30.2
next reply other threads:[~2022-06-10 11:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 11:17 Dominik Csapak [this message]
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox v9 1/1] proxmox-metrics: send_data_to_channels: change from slice to IntoIterator Dominik Csapak
2022-06-13 8:04 ` [pbs-devel] applied: " Wolfgang Bumiller
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 1/7] pbs-api-types: add metrics api types Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 2/7] pbs-config: add metrics config class Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 3/7] backup-proxy: decouple stats gathering from rrd update Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 4/7] proxmox-backup-proxy: send metrics to configured metrics server Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 5/7] api: add metricserver endpoints Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 6/7] ui: add window/InfluxDbEdit Dominik Csapak
2022-06-10 11:17 ` [pbs-devel] [PATCH proxmox-backup v9 7/7] ui: add MetricServerView and use it Dominik Csapak
2022-06-13 8:06 ` [pbs-devel] applied-series: [PATCH proxmox/proxmox-backup v9] add metrics server capability Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220610111757.2788694-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox