Skip to main content

Overlock client library for instrumenting code

Project description

The Overlock python library allows logging and instrumentation of program code as a drop in replacement for python logging, but with some extensions. Only for use with the Overlock Agent for linux.

See for instructions.

Python versions supported:

  • 2.7
  • 3.4
  • 3.5
  • 3.6
  • pypy
  • pypy3

Using the library

The overlock library needs to be ‘installed’ in your code to configure and provide some details to the Overlock Agent:

from overlock import install

    # The name of the application program, defaults to "unknown"
    # Any custom metadata for the app can be added here
        "version": "2.0.1",
        "hardware_revision": get_hardware_version()

When installed, it can be used to log information from all parts of your system

from overlock import OverlockLogger
ol = OverlockLogger() # 1 - Import the logger

def read_sensor():
        value = read_sensor()
        ol.set_state({"sensor_value": value}) # 2 - Use set_state to add state to the store"got a new reading for the sensor") # 3a - Add a log message
        return value
    except SensorReadException as e:
        ol.set_state({"sensor_value": "unknown"})
        ol.exception("Error trying to get sensor value!") # 3b - Log an exception

Running tests

  1. Install tox: pip install tox
  2. Run tests tox

Note: you may want to comment out some of the python versions if your system does not have them installed.

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

overlock-0.2.1.tar.gz (6.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page