Name Description Size
__init__.py 1215
_compat.py 3116
_init_implementation.py Initializes the SDK and optionally integrations. This takes the same arguments as the client constructor. 2559
_log_batcher.py For forking processes we might need to restart this thread. This ensures that our process actually has that thread running. 5085
_lru_cache.py 1229
_queue.py A fork of Python 3.6's stdlib queue (found in Pythons 'cpython/Lib/queue.py') with Lock swapped out for RLock to avoid a deadlock while garbage collecting. https://github.com/python/cpython/blob/v3.6.12/Lib/queue.py See also https://codewithoutrules.com/2017/08/16/concurrency-python/ https://bugs.python.org/issue14976 https://github.com/sqlalchemy/sqlalchemy/blob/4eb747b61f0c1b1c25bdee3856d7195d10a0c227/lib/sqlalchemy/queue.py#L1 We also vendor the code to evade eventlet's broken monkeypatching, see https://github.com/getsentry/sentry-python/pull/484 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; All Rights Reserved PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using this software ("Python") in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; All Rights Reserved" are retained in Python alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python. 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License Agreement. 11250
_types.py Meta information for a data field in the event payload. This is to tell Relay that we have tampered with the fields value. See: https://github.com/getsentry/relay/blob/be12cd49a0f06ea932ed9b9f93a655de5d6ad6d1/relay-general/src/types/meta.rs#L407-L423 10482
_werkzeug.py Copyright (c) 2007 by the Pallets team. Some rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3734
ai
api.py .. versionadded:: 2.0.0 Returns whether Sentry has been initialized or not. If a client is available and the client is active (meaning it is configured to send data) then Sentry is initialized. 11866
attachments.py Additional files/data to send along with an event. This class stores attachments that can be sent along with an event. Attachments are files or other data, e.g. config or log files, that are relevant to an event. Attachments are set on the ``Scope``, and are sent along with all non-transaction events (or all events including transactions if ``add_to_transactions`` is ``True``) that are captured within the ``Scope``. To add an attachment to a ``Scope``, use :py:meth:`sentry_sdk.Scope.add_attachment`. The parameters for ``add_attachment`` are the same as the parameters for this class's constructor. :param bytes: Raw bytes of the attachment, or a function that returns the raw bytes. Must be provided unless ``path`` is provided. :param filename: The filename of the attachment. Must be provided unless ``path`` is provided. :param path: Path to a file to attach. Must be provided unless ``bytes`` is provided. :param content_type: The content type of the attachment. If not provided, it will be guessed from the ``filename`` parameter, if available, or the ``path`` parameter if ``filename`` is ``None``. :param add_to_transactions: Whether to add this attachment to transactions. Defaults to ``False``. 3109
client.py 38668
consts.py The type of an endpoint. This is an enum, rather than a constant, for historical reasons (the old /store endpoint). The enum also preserve future compatibility, in case we ever have a new endpoint. 40631
crons
debug.py 1019
envelope.py Represents a Sentry Envelope. The calling code is responsible for adhering to the constraints documented in the Sentry docs: https://develop.sentry.dev/sdk/envelopes/#data-model. In particular, each envelope may have at most one Item with type "event" or "transaction" (but not both). 10355
feature_flags.py Records a flag and its value to be sent on subsequent error events. We recommend you do this on flag evaluations. Flags are buffered per Sentry scope. 2233
hub.py A custom deprecation warning to inform users that the Hub is deprecated. 25675
integrations
logger.py 2399
metrics.py Enters recursion protection and returns the old flag. 29913
monitor.py Performs health checks in a separate thread once every interval seconds and updates the internal state. Other parts of the SDK only read this state and act accordingly. 3710
profiler
py.typed 0
scope.py The scope holds extra information that should be sent with all events that belong to it. 63332
scrubber.py A scrubber that goes through the event payload and removes sensitive data configured through denylists. :param denylist: A security denylist that is always scrubbed, defaults to DEFAULT_DENYLIST. :param recursive: Whether to scrub the event payload recursively, default False. :param send_default_pii: Whether pii is sending is on, pii fields are not scrubbed. :param pii_denylist: The denylist to use for scrubbing when pii is not sent, defaults to DEFAULT_PII_DENYLIST. 6064
serializer.py A very smart serializer that takes a dict and emits a json-friendly dict. Currently used for serializing the final Event and also prematurely while fetching the stack local variables for each frame in a stacktrace. It works internally with 'databags' which are arbitrary data structures like Mapping, Sequence and Set. The algorithm itself is a recursive graph walk down the data structures it encounters. It has the following responsibilities: * Trimming databags and keeping them within MAX_DATABAG_BREADTH and MAX_DATABAG_DEPTH. * Calling safe_repr() on objects appropriately to keep them informative and readable in the final payload. * Annotating the payload with the _meta field whenever trimming happens. :param max_request_body_size: If set to "always", will never trim request bodies. :param max_value_length: The max length to strip strings to, defaults to sentry_sdk.consts.DEFAULT_MAX_VALUE_LENGTH :param is_vars: If we're serializing vars early, we want to repr() things that are JSON-serializable to make their type more apparent. For example, it's useful to see the difference between a unicode-string and a bytestring when viewing a stacktrace. :param custom_repr: A custom repr function that runs before safe_repr on the object to be serialized. If it returns None or throws internally, we will fallback to safe_repr. 13087
session.py 5571
sessions.py DEPRECATED: Utility function to find out if session tracking is enabled. 9181
spotlight.py 8678
tracing.py The trace ID of the root span. If this new span is to be the root span, omit this parameter, and a new trace ID will be generated. 48114
tracing_utils.py Returns True if either traces_sample_rate or traces_sampler is defined and enable_tracing is set and not false. 28820
transport.py Baseclass for all transports. A transport is used to send an event to sentry. 32604
types.py This module contains type definitions for the Sentry SDK's public API. The types are re-exported from the internal module `sentry_sdk._types`. Disclaimer: Since types are a form of documentation, type definitions may change in minor releases. Removing a type would be considered a breaking change, and so we will only remove type definitions in major releases. 1222
utils.py Maximum number of stack frames to send to Sentry. If we have more than this number of stack frames, we will stop processing the stacktrace to avoid getting stuck in a long-lasting loop. This value exceeds the default sys.getrecursionlimit() of 1000, so users will only be affected by this limit if they have a custom recursion limit. 59368
worker.py Kill worker thread. Returns immediately. Not useful for waiting on shutdown for events, use `flush` for that. 4464