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:

DEFAULT_RESPONSE_HEADERS = {
    "Content-Security-Policy": (
        "default-src 'self'; "
        "script-src 'self' 'nonce-{request.csp_nonce}'; "
        "style-src 'self' 'nonce-{request.csp_nonce}'; "
        "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.15.0.tar.gz (37.6 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.15.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plain_observer-0.15.0.tar.gz
Algorithm Hash digest
SHA256 493313153a4755c4b0e1b9f196a29f1c3429e35feb65bacc5e288b52685ff5a4
MD5 4c5511b488a06c960efecca03747093b
BLAKE2b-256 f40a005e7cf618f22cb591566e7cf3fd5d8835b04ac9fbfdab3ece1409558f48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_observer-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9dcf8c7dae20c6cb93beef9d5c81e96263363388dacbad346aa9df70b7dbb69e
MD5 bde4aa77a8be8b01e630e68a50d25526
BLAKE2b-256 4e35ffb8f37da9f593361fb5af3bb3d04eaa041176070d4c0bacdf280485c956

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