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.2.0.tar.gz (44.2 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.2.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thelab_instrumentation-0.2.0.tar.gz
  • Upload date:
  • Size: 44.2 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.2.0.tar.gz
Algorithm Hash digest
SHA256 73fbcafc914a5f4cf55ca90950aa5e3127c68dbe887bc11497422b9390f3aad7
MD5 7098170dc173f74d1251c43f25464890
BLAKE2b-256 1574d17bb9ff97d2dee9daf10c1b2ceba97613d3cc2175d7ae188d893bcde566

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for thelab_instrumentation-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7009e824bccdd0ee0a941d1e4637b3fa07571af4d3ae17426d88044356b9824
MD5 b47a12e2dec13fc836d5e9da4ebb11a9
BLAKE2b-256 2a7fcc3cec281c37672cce67838470f8d41aadf380bab153e5a380bd4d4c372a

See more details on using hashes here.

Provenance

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