Bug 55367 - UCS Monitoring: write timestamps into node collector files to be more accurate
UCS Monitoring: write timestamps into node collector files to be more accurate
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Monitoring (Prometheus or Nagios)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-4-errata
Assigned To: Florian Best
Christian Castens
https://git.knut.univention.de/univen...
:
Depends on:
Blocks: 56341
  Show dependency treegraph
 
Reported: 2022-10-31 17:05 CET by Florian Best
Modified: 2023-07-19 17:53 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2022-10-31 17:05:10 CET
The node collector collects every N times all metrics from the .prom files.
This is a little bit inaccurate because we don't write the timestamp when the metrics were actually created. This can easily be added as the prom format allows to add a timestamp:

https://prometheus.io/docs/instrumenting/exposition_formats/

metric_name [
  "{" label_name "=" `"` label_value `"` { "," label_name "=" `"` label_value `"` } [ "," ] "}"
] value [ timestamp ]

The timestamp is an int64 (milliseconds since epoch, i.e. 1970-01-01 00:00:00 UTC, excluding leap seconds), represented as required by Go's ParseInt() function.

We also use a self-written library but Debian also provides python3-prometheus-client, which does the protocol handling. We should use that instead.
Comment 2 Florian Best univentionstaff 2023-07-17 15:25:19 CEST
Metrics are now written with timestamps using the python3-prometheus-client library.

univention-monitoring-client.yaml
1fb31b9bfed2 | refactor(monitoring): use prometheus library

univention-monitoring-client (1.0.2-4)
b60d75576c11 | feat(monitoring): add timestamp to metrics to be more accurate
1fb31b9bfed2 | refactor(monitoring): use prometheus library
Comment 3 Christian Castens univentionstaff 2023-07-19 09:15:06 CEST
QA:
  - timestamps in metrics:  OK
  - advisories:  OK
  - no related tracebacks/errors in logfiles:  OK