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.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

statismo-0.2.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: statismo-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8ac91208a3ad1b384c2050bcb84c9f1e400da9a8b9310801f169a482f21c33a9
MD5 4c287a5d5210154a2d21ddf5b0d0f95d
BLAKE2b-256 7aa0e842def7643f1df5069a436f7ea9f250a444e388d1415c649b4335aa38b6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for statismo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fb5fd5775a555c17ec942aab0fb0c6ccadf6f2d3ae9ce2e4d08c0adc3cef95c
MD5 9fb4c8b739a916f7c20af0f52feede81
BLAKE2b-256 fcef02830057f6e4549ecd7ee30c566c12a4d1658a0383b7282dd891ca96bd5e

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