Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lb-telemetry-0.3.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

lb_telemetry-0.3.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file lb-telemetry-0.3.0.tar.gz.

File metadata

  • Download URL: lb-telemetry-0.3.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.15

File hashes

Hashes for lb-telemetry-0.3.0.tar.gz
Algorithm Hash digest
SHA256 05d5af5f1462ba5aaf808ac97970416a52309a794fcf906c6f63d2afa42b77af
MD5 4bf0106d9c14240d900e44f0b38f61ae
BLAKE2b-256 2ab0b2480388304f0a26d17e4f117b4218c4b909b5e9816887b1d44c5fe81e37

See more details on using hashes here.

File details

Details for the file lb_telemetry-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: lb_telemetry-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.15

File hashes

Hashes for lb_telemetry-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd835f2599023d88a795fbb34e45c65d4274ca50d5d891754a1c115b716bb40e
MD5 eea58ce46cedd56548d14c71505a62ed
BLAKE2b-256 a6cb2904400aabcfb9f68f7273a6c352d5d271f8072b241d4a2d57d36296723f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page