Skip to main content

Shared instrumentation and monitoring code for Django projects

Project description

thelab-instrumentation

Latest Release pipeline status coverage report

A fully type-safe instrumentation and monitoring library for Django projects. This package provides:

  • Metrics collection and reporting to various backends (CloudWatch, Logging)
  • RQ queue monitoring
  • Clean, type-safe API with comprehensive mypy typing

Installation

Install the package using your package manager of choice:

# Using uv (recommended)
uv pip install thelab-instrumentation

# Using pip
pip install thelab-instrumentation

Add the package to your Django INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'thelabinstrumentation',
    'thelabinstrumentation.rq',  # Include if using RQ monitoring
    # ...
]

Configuration

Configure the library in your Django settings:

THELAB_INSTRUMENTATION = {
    # Metrics backend (default: logging backend)
    'BACKEND': 'thelabinstrumentation.backends.cloudwatch.CloudWatchBackend',

    # Backend-specific options
    'OPTIONS': {
        # Cloudwatch Backend
        "namespace": 'MyApplication',
    },

    # Update interval in seconds (default: 60)
    'UPDATE_INTERVAL': 60,

    # Global dimensions added to all metrics
    'DIMENSIONS': {
        'Environment': 'production',
        'Application': 'my-app',
    },
}

Development

Setup Development Environment

# Clone the repository
git clone https://gitlab.com/thelabnyc/thelab-instrumentation.git
cd thelab-instrumentation

# Install dependencies
uv sync

# Install pre-commit hooks
pre-commit install

Run Tests

# Run all tests
uv run tox

# Run mypy type checking
uv run mypy thelabinstrumentation/

# Run linting
uv run ruff check

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

thelab_instrumentation-0.4.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thelab_instrumentation-0.4.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file thelab_instrumentation-0.4.0.tar.gz.

File metadata

  • Download URL: thelab_instrumentation-0.4.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for thelab_instrumentation-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7bd821295c057444f9a56d830d0d4e884b60f7a63520c8ec749401c14f5edd26
MD5 1fec595e4dbaa9417922dfc44a084c4c
BLAKE2b-256 1dc61d6eb00b77875216c13d11210032ca40d828a7e4908b9559567278dc440b

See more details on using hashes here.

Provenance

The following attestation bundles were made for thelab_instrumentation-0.4.0.tar.gz:

Publisher: .gitlab-ci.yml on thelabnyc/thelab-instrumentation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file thelab_instrumentation-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thelab_instrumentation-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fdb9973b255cc51c1dca10b98aef4b283f4e2048b59bad98c6f4726cd6e400c
MD5 af71f693a187730ff1e543e18b66e2ca
BLAKE2b-256 cb2a1060c075c0ae6059d4fd0c0e5d8836b493d803d986e35cfa3d1d6255b5c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for thelab_instrumentation-0.4.0-py3-none-any.whl:

Publisher: .gitlab-ci.yml on thelabnyc/thelab-instrumentation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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