Commit Graph

24 Commits

Author SHA1 Message Date
Thomas Lamprecht
5d551f5e2a influxdb: rework comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-26 17:38:22 +02:00
Lorenz Stechauner
456be47171 fix #3440: influxdb: remove duplicate vmid tag
remove vmid from data part, it is already contained in object part.
this is accomplished by adding the parameter $excluded to
build_influxdb_payload().

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-05-26 17:36:54 +02:00
Dominik Csapak
bc33c73963 metrix: influx: fix default api_prefix
we set the api prefix by default to '/' so we always triggered
the the replacement and added '///' which is wrong and does not
work for the 'health' api path
(influxdb returns 404 for 'https://ip:port///health')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-03-15 15:28:11 +01:00
Dominik Csapak
c7777408ea metrics: influx: special case 'health' api path i _get_v2url
the forwards compatible api of 1.8 only contains this path
(not api/v2/health) and it it also contained in the v2 api

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-03-15 15:26:46 +01:00
Thomas Lamprecht
23c9eaf63d metrics: influx: allow one to add an API URL-path prefix
I normally use a reverse proxy in front of my influxdb instances,
proxying all from the /influx/ path to the only locally listening
influxdb. So here I'd need to set "influx" as api-path-prefix.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
6e5405fb21 metrics: influx: do not error out when credendtials could not be loaded
Not a hard error, some network box (proxy) down the line could add it
for us, or it could be just not required, so ...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
bb35a833d1 metrics: influx: send along auth token on connection test too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
9f8d8f2b05 metrics: influx: include unrecognized protocol value in error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-15 14:45:05 +01:00
Thomas Lamprecht
f8d1d5ad9a ext. metris. fixup InfluxDB spelling in schema and code style
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-03-13 21:30:03 +01:00
Thomas Lamprecht
c2162150f1 metric status: fix misspelled method call
reported in:
https://forum.proxmox.com/threads/typo-in-influxdb-pm.85017/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-27 16:11:09 +01:00
Dominik Csapak
6b6eb15c7d status/influxdb: remove unnecessary comment
we already have that information in the reference docs, no need to
have it here as well

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-01-28 17:32:23 +01:00
Dominik Csapak
ccb614311d status/influxdb: implement influxdb 2.x http api
needs an organization/bucket (previously db) and an optional token
the http client does not fit exactly in the connect/send/disconnect
scheme, so it simply creates a request in 'connect',
does the actual http connection in 'send' and nothing in 'disconnect'

max-body-size is set to 25.000.000 bytes by default (the influxdb default)
and the timeout to 1 second (same as default graphite tcp timeout)

the token (if given) gets saved in /etc/pve/priv/metricserver/$ID.pw
it is optional, because the 1.8.x compatibility api does not need
authentication (in contrast to influxdb 2.x)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-01-28 17:32:23 +01:00
Thomas Lamprecht
2c4bf90ff0 influxdb: avoid three line comment if one is enough
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:39:33 +01:00
Fabian Grünbichler
0fc553eb1b status/metrics: make MTU configurable
since some users don't even have a full 1500 (and some systems might
have links with bigger MTU and not require as much fragmentation).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-10-29 08:51:51 +01:00
Thomas Lamprecht
5c77a34f08 metric server: improve flush on big data updates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-08 17:15:44 +02:00
Thomas Lamprecht
87be2c19e3 ext. metric: move to a transaction model
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:04:29 +01:00
Thomas Lamprecht
68f58b5d59 status plugins: add _connect to plugin method interface
in preparation of doing real transactions, with one batch connect +
send + disconnect, and not hundreds of those per update cycle..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-14 19:27:28 +01:00
Thomas Lamprecht
fa6f371649 cleanup Status plugins use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-11 09:22:04 +02:00
Dominik Csapak
8077d94a02 fix #2030: use looks_like_number for number check
since numbers can also be in '1.e-10' format, we have to change
how we check for a number

Scalar::Util is already core and we use it in PVE::Tools, so
no new dependecy.

in case of "NaN" or "Infinity" we omit the key/value pair

else we quote like before

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-07 15:01:18 +01:00
Thomas Lamprecht
09f19204be InfluxDB plugins: send nodename when updating CT/VM status
This allows filtering by node in InfluxDB queries, so the statistics
of all virtual guests on a specific nodes can be queried.

While for InfluxDB this is only a tag which does changes where the
data is stored, Graphite - our other status plugin - has no such
mechanics available. If we would add it to the object hierarchy,
e.g.: "qemu.$vmid.$nodename" a migration of a VM would result in two
different datasets.
So avoid breaking setups and omit it for Graphite for now.

Suggested-by: Daniel1108 <danielgallegosanchez@gmail.com>
CC: Daniel1108 <danielgallegosanchez@gmail.com>

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-02-28 11:28:10 +01:00
Dominik Csapak
7d7f77ba06 fix influxdb field assignment and allow non integer field
this patch fixes an issue where we assemble the influxdb
key value pairs to the wrong measurement

and also we did only allow integer fields,
excluding all cpu,load and wait measurements

this patch fixes both issues with a rewrite of the
recursive build_influxdb_payload sub

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-08-02 13:15:47 +02:00
Thomas Lamprecht
f014da61c5 Status: report errors on socket creation problems
If the socket couldn't be created (e.g. FQDN not resolvable) we
continued witouth any hint, when actualy writing the data we then
die'd. The user then does not really know why, so report errors
if the socket creation failed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-05-23 09:17:42 +02:00
Alexandre Derumier
988b5a267d influxdb : use multi values measurement
influxdb (> 0.9.5) now support fastly multiple values by mesuerement,
through a new column store engine.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-22 11:24:19 +01:00
Alexandre Derumier
58541b9463 add influxdb stats plugin V2
/etc/pve/status.cfg
-------------------
influxdb:
      server influxdb3.odiso.net
      port 8089

This require influxdb >= 0.9 with udp enabled

influxdb.conf
-------------

[[udp]]
  enabled = true
  bind-address = "0.0.0.0:8089"
  database = "proxmox"
  batch-size = 1000
  batch-timeout = "1s"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-11 07:59:34 +02:00