Skip to main content

Transport for Sentry that saves failed-to-send events on disk and resends them on the next launch.

Project description

sentry-offline-transport

Ruff codecov PyPI - Version PyPI - Python Version PyPI - Downloads

Transport for Sentry that saves failed-to-send events and resends them on the next launch.

Installation

sentry-offline-trasport requires Python >= 3.8.0, sentry-sdk >= 2.0.0.

Install from PyPI using pip or any other Python package manager.

pip install sentry-offline-transport

Usage

To start using the transport, you have to provide a path to store failed events. It can be an absolute or a relative path, either a string or a Path object. If the directory doesn't exist, it will be created along with all required parent directories.

By default, the transport will try to upload previously saved events right after the initialization. You can configure this behavior using the reupload_on_startup parameter.

import sentry_sdk
from sentry_offline import make_offline_transport

sentry_sdk.init(
    dsn="https://asdf@abcd1234.ingest.us.sentry.io/1234",
    transport=make_offline_transport(
        storage_path="~/.local/share/myapp/sentry_events", 
        reupload_on_startup=False,
    ),
)

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

sentry_offline_transport-1.0.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

sentry_offline_transport-1.0.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page