Skip to main content

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

from lb_telemetry import Logger

# 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().log_to_monit(
    "NameOfThisPackage",  # Or other readable identifier
    telemetry,
    tags=["version", "some_tag"],  # `exec_time` and `some_field` interpreted as fields
)

Running the CLI

The default value for --table is 'CLI'.

lb-telemetry send '{"test_field": "test_value"}' --include-host-info

Tags can be specified by:

lb-telemetry send '{"field1": 0, "tag1": 5, "tag2": 2}' --table some_table --tags tag1 tag2

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.

Release files for lb-telemetry 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lb-telemetry 0.5.0
File Size Uploaded
lb-telemetry-0.5.0.tar.gz 26.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lb-telemetry 0.5.0
File Interpreter ABI Platform
lb_telemetry-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / lb-telemetry-0.5.0.tar.gz

Download URL lb-telemetry-0.5.0.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e73bc117d72f77fd2b8ad9b4483dddb9f07e90f95c4ca21c70b7123282aa59f6
BLAKE2b-256 checksum
How to use checksums
7a1a6871b914472b125e488b806a3d8913c4902a9828449813a097c89c00b137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.15

Release files / lb_telemetry-0.5.0-py3-none-any.whl

Download URL lb_telemetry-0.5.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45c2ef5a5bdb98446f0a57b71742ef76b0a3add44e58ab059761ccc5d6fd1bbf
BLAKE2b-256 checksum
How to use checksums
ba24c65fe1aef4e0681cb17ca136eb0f3e20a47d3941a306bc9d636938029ca5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.15

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page