Skip to main content

The official client library for the Pensieve APM.

Project description

pensieve-client 🚀

PyPI Version License: MIT

A lightweight, Django-first APM and error-tracking client for the Pensieve observability platform.

This package is a client library designed to be installed in any Django project. It automatically monitors your application's performance and tracks exceptions.

Its main feature is a fully integrated Django Admin dashboard—it adds a "Performance Insights" page directly to your project's own admin panel, allowing you to see your site's health without ever leaving your workspace.

Features ✨

  • 📈 Integrated Admin Dashboard: View error and performance charts directly in your site's /admin/.
  • 🐛 Automatic Exception Tracking: Captures and groups unhandled exceptions with full stack traces.
  • ⏱️ Performance Monitoring: Tracks request/response times for all your views.
  • 📊 Interactive Charts: Provides a "Top 5 Slowest Endpoints" summary and interactive, filterable line charts for drilling down into a specific URL's performance history.
  • ⚙️ Lightweight & Configurable: Designed to be low-overhead. Automatically excludes its own dashboard URLs from being monitored.

Installation

  1. Install the package using pip:

    pip install pensieve
    
  2. Add pensieve_client to your INSTALLED_APPS in settings.py.

    # settings.py
    
    INSTALLED_APPS = [
        # ... other apps
        'django.contrib.admin',
        'django.contrib.auth',
        # ...
        'pensieve_client',
    ]
    
  3. Add the Pensieve middleware to your settings.py. It's recommended to place it at the bottom of the list to ensure it correctly wraps your views.

    # settings.py
    
    MIDDLEWARE = [
        'django.middleware.security.SecurityMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        # ... other middleware
        'pensieve_client.middleware.PensieveMiddleware', # <-- Add this
    ]
    

Configuration

Visit pensieve.harshitajn.tech and register with email, password and name. Create a project and you will get an api key for the project.

Add the following settings to your project's settings.py file:

# settings.py

# Your unique project API key from your Pensieve server dashboard
PENSIEVE_API_KEY = "your-project-api-key-from-pensieve"

# This is the exact url you have to mention in settings.py to get the metrics
PENSIEVE_URL = "[https://pensieve.harshitanjn.tech/api](https://pensieve.harshitajn.tech/api)" 

# (Optional) A list of URL paths to exclude from performance tracking.
# It's a good idea to exclude the admin panel to reduce noise.
PENSIEVEGRID_EXCLUDE_URLS = [
    '/admin/',
    '/__debug__/',
]

How to Use 📊

Once the package is installed and configured:

  1. Run your Django project.

  2. Log in to your project's admin panel (e.g., http://127.0.0.1:8000/admin/).

  3. In the admin homepage, you will see a new section (likely "AUTHENTICATION AND AUTHORIZATION") with a link named "Pensieve Dashboards".

  4. Click this link to view your project's performance and error data, which is displayed directly within your own admin.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

pensivium-0.1.3.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pensivium-0.1.3-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file pensivium-0.1.3.tar.gz.

File metadata

  • Download URL: pensivium-0.1.3.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pensivium-0.1.3.tar.gz
Algorithm Hash digest
SHA256 577afdac72ac2a9e25e1a8d55af204f9305d2b9491e5804a7cca21707010a95f
MD5 2ca05d7551978b1edc92a888385dd1ce
BLAKE2b-256 964675ed99d14ed54e37805656c85fb4a5b2d93b2d842145d7305e62c59a2a74

See more details on using hashes here.

File details

Details for the file pensivium-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pensivium-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for pensivium-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 54285ff1337f4f2b335e506e6f2259d66b2ca49c1f0617a921dde04c6bfd07ac
MD5 138714bf9512e1465a9a56373eea2358
BLAKE2b-256 8659c5f9d483bfb6ae28d8aa09f83e04144e3987660f92bbb3b35c142e71a499

See more details on using hashes here.

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