Skip to main content

datasette-sentry

PyPI Changelog Tests License

Datasette plugin for configuring Sentry for error reporting

Installation

pip install datasette-sentry

Usage

This plugin only takes effect if your metadata.json file contains relevant top-level plugin configuration in a "datasette-sentry" configuration key.

You will need a Sentry DSN - see their Getting Started instructions.

Add it to metadata.json like this:

{
    "plugins": {
        "datasette-sentry": {
            "dsn": "https://KEY@sentry.io/PROJECTID"
        }
    }
}

Settings in metadata.json are visible to anyone who visits the /-/metadata URL so this is a good place to take advantage of Datasette's secret configuration values, in which case your configuration will look more like this:

{
    "plugins": {
        "datasette-sentry": {
            "dsn": {
                "$env": "SENTRY_DSN"
            }
        }
    }
}

Then make a SENTRY_DSN environment variable available to Datasette.

Configuration

In addition to the dsn setting, you can also configure the Sentry sample rate by setting sample_rate to a floating point number between 0 and 1.

For example, to capture 25% of errors you would do this:

{
    "plugins": {
        "datasette-sentry": {
            "dsn": {
                "$env": "SENTRY_DSN"
            },
            "sample_rate": 0.25
        }
    }
}

Performance monitoring

Sentry Performance Monitoring records full traces of page for further analysis, in addition to tracking errors.

You can enable that by adding "enable_tracing" to your plugin configuration:

{
    "plugins": {
        "datasette-sentry": {
            "dsn": {
                "$env": "SENTRY_DSN"
            },
            "enable_tracing": true
        }
    }
}

The default sample rate if you do this will be 1.0, meaning every response will be traced. This can get expensive - you can adjust the tracing rate using traces_sample_rate. Set that to 0.1 to sample 10% of requests, for example:

{
    "plugins": {
        "datasette-sentry": {
            "dsn": {
                "$env": "SENTRY_DSN"
            },
            "enable_tracing": true,
            "traces_sample_rate": 0.1
        }
    }
}

Metadata

Release files for datasette-sentry 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datasette-sentry 0.4
File Size Uploaded
datasette-sentry-0.4.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datasette-sentry 0.4
File Interpreter ABI Platform
datasette_sentry-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / datasette-sentry-0.4.tar.gz

Download URL datasette-sentry-0.4.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
662b00661f8f0f6b91de0504d7c356d991eddf36bfe61d43afd36c7ca3472df3
BLAKE2b-256 checksum
How to use checksums
fc6ca4f5fd7f3ffe06c05cf49ad8363f2cdb3e8f0099d544d511e6ae15ad1ef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release files / datasette_sentry-0.4-py3-none-any.whl

Download URL datasette_sentry-0.4-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9dc7276039d7c5688b904416e3ceeb94773c23dcb0b20a450e2ea282b201f8ca
BLAKE2b-256 checksum
How to use checksums
ab2f46a300bb5fdee640481692547e1e10746bc2a8defce3bf64898bcf06ab77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page