A utility for logging telemetry data from LHCb packages to MONIT
Project description
lb-telemetry
A utility for logging telemetry data about LHCb packages to MONIT. Usage data graphs specific to each package can be viewed on the MONIT Grafana.
The package is not user-callable. It is intended to be imported and called by other LHCb packages such as PIDCalib2.
Setup
Installing from PyPI
The package is available on PyPI.
It can be installed on any computer via pip
by running (preferably in a virtual environment):
pip install lb-telemetry
Usage
Adding to a package
# Time execution (optional)
start_time = time.perf_counter()
do_some_task()
exec_time = time.perf_counter() - start_time
telemetry = {
"exec_time": exec_time,
"version": VERSION,
"some_field": "field_value",
"some_tag": "tag_value",
}
logger = Logger()
Logger().log_to_monit(
"NameOfThisPackage", # Or other readable identifier
telemetry,
tags=["version", "some_tag"],
)
Viewing the telemetry
Logged telemetry is usually visible in under a minute and can be accessed via this Grafana dashboard. Request permission to edit the dashboard from an LHCb Grafana org admin if necessary. Then create a new row on the dashboard for your package and add the desired graphs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lb_telemetry-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f81cc2e8e890686e08f7c1330dce205026a5ff95829faa1fa18e20ed640896cd |
|
MD5 | 07ac2a462c6ca90ce81ecbc5a79caa34 |
|
BLAKE2b-256 | 4d51349880d11d53e5aeebdf77ed5dafa370ad5a0caf6bc753e2d6eca32f441f |