Skip to main content

On-page telemetry and observability tools for Plain.

Project description

plain.observer

On-page telemetry and observability tools for Plain.

Installation

Install the plain.observer package from PyPI:

uv add plain.observer

Add plain.observer to your INSTALLED_PACKAGES:

# app/settings.py
INSTALLED_PACKAGES = [
    # ...
    "plain.observer",
]

Include the observer URLs in your URL configuration:

# app/urls.py
from plain.observer.urls import ObserverRouter
from plain.urls import Router, include

class AppRouter(Router):
    namespace = ""
    urls = [
        # ...
        include("observer/", ObserverRouter),
    ]

Run migrations to create the necessary database tables:

plain migrate

After installation, Observer will automatically integrate with your application's toolbar (if using plain.admin). You can access the web interface at /observer/traces/ or use the CLI commands to analyze traces.

Content Security Policy (CSP)

If you're using a Content Security Policy (CSP), the Observer toolbar panel requires frame-ancestors 'self' to display trace information in an iframe.

Without this directive, the toolbar panel will fail to load with a CSP error: "Refused to frame... because an ancestor violates the following Content Security Policy directive: 'frame-ancestors 'none'".

Example CSP configuration:

def DEFAULT_RESPONSE_HEADERS(request):
    nonce = request.csp_nonce
    return {
        "Content-Security-Policy": (
            f"default-src 'self'; "
            f"script-src 'self' 'nonce-{nonce}'; "
            f"style-src 'self' 'nonce-{nonce}'; "
            f"frame-ancestors 'self'; "  # Required for Observer toolbar
            # ... other directives
        ),
    }

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

plain_observer-0.13.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

plain_observer-0.13.0-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file plain_observer-0.13.0.tar.gz.

File metadata

  • Download URL: plain_observer-0.13.0.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.6

File hashes

Hashes for plain_observer-0.13.0.tar.gz
Algorithm Hash digest
SHA256 333d5d2ca630ffd52e738c888b723d2c7fb4b30e4f577858a84ef496b002ed74
MD5 f3c7d329b1254c93eb4ba541877d7303
BLAKE2b-256 b35d5a7142c08e0afb84ea0eea93c3d3c07be6727ac7aa1a55a3e8166e972f25

See more details on using hashes here.

File details

Details for the file plain_observer-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plain_observer-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f1e558b1349d2686750e0c30177fd6abf8965e1c53ca2773d1395c621e288f7
MD5 3c41c3c2f16a9ca0dc5f9b55c9fee80f
BLAKE2b-256 c0e7167ba645c89bf0a8327536e4474cb2a174d554536b6b40716f95a7dbc18e

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