Skip to main content

A Sentry extension to support Alicloud Tablestore (OTS) as a node storage backend.

Project description

sentry-tablestore

An extension for Sentry which support Alicloud Tablestore (OTS) as a node storage backend.

Objectives

Sentry provides an abstraction called ‘nodestore’ which is used for storing key/value blobs.

It's implemented by BigTable (a service of Google Cloud Platform) in sentry.io.

But for self-hosted Sentry, it's implemented by Django default. This means the large amounts of key-value data were stored in the SQL database.

It's horrible, it can lead to rapid growth in the size of SQL database, and make it difficult to clean up.

For more details from https://forum.sentry.io/t/postgres-nodestore-node-table-124gb/12753/3 .

Therefore, this project came into being. It provides a new solution in addition to Django Database or BigTable, that is Alicloud Tablestore (OTS).

Features

  • Implement the TablestoreNodeStorage backend.
  • Support migrating data from current nodestore backend to the new one.

Prerequisites

Sentry 21.9.0 or higher.

An Tablestore instance of Alibaba Cloud (International) or Aliyun (China).

Installation

To install, simply add sentry-tablestore to your requirements.txt for your Sentry environment (or pip install sentry-tablestore).

Configuration

To configure Sentry to use this module, set sentry_tablestore.nodestore.backend.TablestoreNodeStorage to your SENTRY_NODESTORE in your sentry.conf.py, like this:

from datetime import timedelta

SENTRY_NODESTORE = 'sentry_tablestore.nodestore.backend.TablestoreNodeStorage'
SENTRY_NODESTORE_OPTIONS = {
    # Get help from https://www.alibabacloud.com/help/tablestore/latest/python-sdk-initialization
    'end_point': '',
    'access_key_id': '',
    'access_key_secret': '',
}

Then, add any applicable configuration options. Depending on your environment, and especially if you are running Sentry in containers, you might consider using python-decouple so you can set these options via environment variables.

Example Configuration

from datetime import timedelta
SENTRY_NODESTORE = 'sentry_tablestore.nodestore.backend.TablestoreNodeStorage'
SENTRY_NODESTORE_OPTIONS = {
    # Auto clean data for 90 days from its creation
    'default_ttl': timedelta(days=90),
    'automatic_expiry': True,

    # Get help from https://www.alibabacloud.com/help/tablestore/latest/python-sdk-initialization
    'end_point': 'https://sentry-self-hosted.cn-shanghai.vpc.tablestore.aliyuncs.com',
    'access_key_id': 'LTAI****************LYhz',
    'access_key_secret': 'MKs5**********************6t0J',

    # A boolean whether to enable zlib-compression, or the string "zstd" to use zstd.
    # Use zstd compression to override the default zlib for more compact and more efficient
    'compression': 'zstd'
}

# Set log-level for debugging
import logging
logger = logging.getLogger('sentry_tablestore.kvstore.tablestore') # Logger of this project
logger.setLevel(logging.DEBUG)
logger = logging.getLogger('tablestore-client') # Logger of Alicloud SDK
logger.setLevel(logging.DEBUG)

Bootstrap

Execute the command to bootstrap tablestore (create or update the table):

sentry upgrade --with-nodestore

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-tablestore-1.0.0a3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

sentry_tablestore-1.0.0a3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file sentry-tablestore-1.0.0a3.tar.gz.

File metadata

  • Download URL: sentry-tablestore-1.0.0a3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for sentry-tablestore-1.0.0a3.tar.gz
Algorithm Hash digest
SHA256 3b7c9f215188987e080af00ce3ce1d7f3adcd427af862f2224bd794ad9839615
MD5 60337b063b6d178e6e1dff1c4ea854c8
BLAKE2b-256 300ab2095d1f4e38e4f21e5a2dd0a2707706bb870ac62a49086609f7358645bd

See more details on using hashes here.

File details

Details for the file sentry_tablestore-1.0.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for sentry_tablestore-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 899c8fc8870b591bb4c30ac8bad364d4dfd9e53e845266423717f63ae5294605
MD5 502c68dd9d67d13dd734043ef04a8000
BLAKE2b-256 8c1eee8e5df62550b02d6c0bb0bb883438dc4d5073e2fb210cc01f7f65cad7d0

See more details on using hashes here.

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