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.3.0.tar.gz (44.7 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.3.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thelab_instrumentation-0.3.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for thelab_instrumentation-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c23c86241b0f8f75c27a98110b5b68ca9f1eaac0fad098ad93fb4ef8b186d25a
MD5 8953e44ead8e9f54a9dc750615ea22a4
BLAKE2b-256 e3875e32088cdc884e5cc3792b78921e5a5f812c5916ccd2c5bd7428c987c91f

See more details on using hashes here.

Provenance

The following attestation bundles were made for thelab_instrumentation-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thelab_instrumentation-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e60446436a73288a0fdedf02b109b1ee0de3d38747caad508dc76bf351b574b
MD5 28852faf04edd6a23ff67a9ad050ebd0
BLAKE2b-256 054c32fa651c83b4cf13353c6b12cb1971a351adc6fb1952ef6151f34c79bf14

See more details on using hashes here.

Provenance

The following attestation bundles were made for thelab_instrumentation-0.3.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