Skip to main content

A minimal collector of custom metrics for django apps.

Project description

Statismo

Statismo is minimal collector of custom metrics for django applications. It aggregates statistics into a configurable backend before periodically pushing them to an external service such as Cloudwatch.

Currently, supports the following backends:

  • Django's database
  • Redis

And the following services:

  • AWS Cloudwatch

Installation

To install statismo, simply run:

pip install statismo

To use statismo with redis:

pip install statismo[redis]

Configuration

Add statismo to your INSTALLED_APPS setting:

INSTALLED_APPS = [
    ...,
    'statismo',
]

Add the following settings to your settings.py to use the django database collector, which is suitable for small to medium-sized applications:

STATISMO_METRIC_COLLECTOR = 'statismo.collectors.db.DatabaseCollector'

For larger applications, you may want to use the Redis collector:

STATISMO_METRIC_COLLECTOR = 'statismo.collectors.redis.RedisCollector'
STATISMO_METRIC_URL = 'redis://localhost:6379/0'

Finally, to use a custom namespace for your metrics other than the default of statismo, add the following setting:

STATISMO_METRIC_NAMESPACE = 'myapp'

Finally, the periodic task that uploads metrics needs to be enabled. If you're using Celery's django integration, this can be done by adding the following to your settings.py:

CELERY_BEAT_SCHEDULE = {
    "accumulate-metrics-every-5-minutes": {
        "task": "statismo.tasks.accumulate_metrics",
        "schedule": 60 * 5,
    }
}

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

statismo-0.2.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

statismo-0.2.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file statismo-0.2.1.tar.gz.

File metadata

  • Download URL: statismo-0.2.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.7

File hashes

Hashes for statismo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9806edd3dad795d5ed9cb8e0d950063dedcdd8fb1e5143da5c9ffe253fccdf6c
MD5 753468121bcb1bd5c0a6307489b97d43
BLAKE2b-256 4c00b471903e33bee7ee837c737547ab205f02c6264eb611c26571065ec960d7

See more details on using hashes here.

File details

Details for the file statismo-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: statismo-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.7

File hashes

Hashes for statismo-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b82fba6c5a006d34cd37a49e2029b0bc9a705b134e952d98e525b0e133090e7
MD5 bd48c0e2fe7dbb02fa25d6dd7ff2611d
BLAKE2b-256 18bd3858d487a4895e78c70a7f5f24ff3a0851b13bf6ea19261de93d6a1a6ddd

See more details on using hashes here.

Supported by

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