Shared instrumentation and monitoring code for Django projects
Project description
thelab-instrumentation
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c23c86241b0f8f75c27a98110b5b68ca9f1eaac0fad098ad93fb4ef8b186d25a
|
|
| MD5 |
8953e44ead8e9f54a9dc750615ea22a4
|
|
| BLAKE2b-256 |
e3875e32088cdc884e5cc3792b78921e5a5f812c5916ccd2c5bd7428c987c91f
|
Provenance
The following attestation bundles were made for thelab_instrumentation-0.3.0.tar.gz:
Publisher:
.gitlab-ci.yml on thelabnyc/thelab-instrumentation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thelab_instrumentation-0.3.0.tar.gz -
Subject digest:
c23c86241b0f8f75c27a98110b5b68ca9f1eaac0fad098ad93fb4ef8b186d25a - Sigstore transparency entry: 250766554
- Sigstore integration time:
-
Permalink:
thelabnyc/thelab-instrumentation@c18e7be6544cdcbabee03e889c9d47334279ca71 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://gitlab.com/thelabnyc
-
Access:
public
-
Token Issuer:
https://gitlab.com -
Runner Environment:
self-hosted -
Publication workflow:
.gitlab-ci.yml@c18e7be6544cdcbabee03e889c9d47334279ca71 -
Trigger Event:
push
-
Statement type:
File details
Details for the file thelab_instrumentation-0.3.0-py3-none-any.whl.
File metadata
- Download URL: thelab_instrumentation-0.3.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e60446436a73288a0fdedf02b109b1ee0de3d38747caad508dc76bf351b574b
|
|
| MD5 |
28852faf04edd6a23ff67a9ad050ebd0
|
|
| BLAKE2b-256 |
054c32fa651c83b4cf13353c6b12cb1971a351adc6fb1952ef6151f34c79bf14
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thelab_instrumentation-0.3.0-py3-none-any.whl -
Subject digest:
0e60446436a73288a0fdedf02b109b1ee0de3d38747caad508dc76bf351b574b - Sigstore transparency entry: 250766547
- Sigstore integration time:
-
Permalink:
thelabnyc/thelab-instrumentation@c18e7be6544cdcbabee03e889c9d47334279ca71 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://gitlab.com/thelabnyc
-
Access:
public
-
Token Issuer:
https://gitlab.com -
Runner Environment:
self-hosted -
Publication workflow:
.gitlab-ci.yml@c18e7be6544cdcbabee03e889c9d47334279ca71 -
Trigger Event:
push
-
Statement type: