Skip to content

Commit

Permalink
feat: disable transaction log decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
hartym committed Jan 18, 2022
1 parent a5504d7 commit 0b7c2cc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mstd/sentry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sentry_sdk


def disable_sentry_transaction_log():
"""
Sentry transactions are the APM-side of sentry, and some recurring tasks will saturate our event quota without real
value. For example, background jobs have no real value of being logged in sentry transactions and a lot ot them
are run on a regular basis.
"""

with sentry_sdk.configure_scope() as scope:
if scope.transaction:
scope.transaction.sampled = False
17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from setuptools import setup


setup(
name='mstd_sentry',
version='0.0.1',
description='',
long_description='',
author='Romain Dorgueil',
author_email='romain@makersquad.fr',
license='Apache Software License',
packages=['mstd.sentry'],
install_requires=[
"sentry-sdk ~= 1.5.2",
],
zip_safe=False,
)

0 comments on commit 0b7c2cc

Please sign in to comment.