Top Level API#
This is the user facing API of the SDK. It’s exposed as sentry_sdk.
With this API you can implement a custom performance monitoring or error reporting solution.
Initializing the SDK#
- class sentry_sdk.client.ClientConstructor(dsn=None, *, max_breadcrumbs=100, release=None, environment=None, server_name=None, shutdown_timeout=2, integrations=[], ignore_spans=None, in_app_include=[], in_app_exclude=[], default_integrations=True, dist=None, transport=None, transport_queue_size=100, sample_rate=1.0, data_collection={}, http_proxy=None, https_proxy=None, ignore_errors=[], max_request_body_size='medium', socket_options=None, keep_alive=None, before_send=None, before_breadcrumb=None, debug=None, attach_stacktrace=True, ca_certs=None, traces_sample_rate=None, trace_lifecycle=None, traces_sampler=None, profiler_mode=None, profile_lifecycle='manual', profile_session_sample_rate=None, auto_enabling_integrations=True, disabled_integrations=None, auto_session_tracking=True, send_client_reports=True, _experiments={}, proxy_headers=None, project_root=None, trace_propagation_targets=['.*'], functions_to_trace=[], max_value_length=None, enable_backpressure_handling=True, error_sampler=None, enable_db_query_source=True, db_query_source_threshold_ms=100, enable_http_request_source=True, http_request_source_threshold_ms=100, spotlight=None, cert_file=None, key_file=None, custom_repr=None, add_full_stack=False, max_stack_frames=100, before_send_log=None, before_send_metric=None, before_send_span=None, org_id=None, strict_trace_continuation=False)[source]
- __init__(dsn=None, *, max_breadcrumbs=100, release=None, environment=None, server_name=None, shutdown_timeout=2, integrations=[], ignore_spans=None, in_app_include=[], in_app_exclude=[], default_integrations=True, dist=None, transport=None, transport_queue_size=100, sample_rate=1.0, data_collection={}, http_proxy=None, https_proxy=None, ignore_errors=[], max_request_body_size='medium', socket_options=None, keep_alive=None, before_send=None, before_breadcrumb=None, debug=None, attach_stacktrace=True, ca_certs=None, traces_sample_rate=None, trace_lifecycle=None, traces_sampler=None, profiler_mode=None, profile_lifecycle='manual', profile_session_sample_rate=None, auto_enabling_integrations=True, disabled_integrations=None, auto_session_tracking=True, send_client_reports=True, _experiments={}, proxy_headers=None, project_root=None, trace_propagation_targets=['.*'], functions_to_trace=[], max_value_length=None, enable_backpressure_handling=True, error_sampler=None, enable_db_query_source=True, db_query_source_threshold_ms=100, enable_http_request_source=True, http_request_source_threshold_ms=100, spotlight=None, cert_file=None, key_file=None, custom_repr=None, add_full_stack=False, max_stack_frames=100, before_send_log=None, before_send_metric=None, before_send_span=None, org_id=None, strict_trace_continuation=False)[source]
Initialize the Sentry SDK with the given parameters. All parameters described here can be used in a call to sentry_sdk.init().
- Parameters:
The DSN tells the SDK where to send the events.
If this option is not set, the SDK will just not send any data.
The dsn config option takes precedence over the environment variable.
Learn more about DSN utilization.
Turns debug mode on or off.
When True, the SDK will attempt to print out debugging information. This can be useful if something goes wrong with event sending.
The default is always False. It’s generally not recommended to turn it on in production because of the increase in log output.
The debug config option takes precedence over the environment variable.
Sets the release.
If not set, the SDK will try to automatically configure a release out of the box but it’s a better idea to manually set it to guarantee that the release is in sync with your deploy integrations.
Release names are strings, but some formats are detected by Sentry and might be rendered differently.
See the releases documentation to learn how the SDK tries to automatically configure a release.
The release config option takes precedence over the environment variable.
Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in the product documentation.
Sets the environment. This string is freeform and set to production by default.
A release can be associated with more than one environment to separate them in the UI (think staging vs production or similar).
The environment config option takes precedence over the environment variable.
The distribution of the application.
Distributions are used to disambiguate build or deployment variants of the same release of an application.
The dist can be for example a build number.
sample_rate (
float) –Configures the sample rate for error events, in the range of 0.0 to 1.0.
The default is 1.0, which means that 100% of error events will be sent. If set to 0.1, only 10% of error events will be sent.
Events are picked randomly.
error_sampler (
Optional[Callable[[Event,Dict[str,Any]],Union[float,bool]]]) –Dynamically configures the sample rate for error events on a per-event basis.
This configuration option accepts a function, which takes two parameters (the event and the hint), and which returns a boolean (indicating whether the event should be sent to Sentry) or a floating-point number between 0.0 and 1.0, inclusive.
The number indicates the probability the event is sent to Sentry; the SDK will randomly decide whether to send the event with the given probability.
If this configuration option is specified, the sample_rate option is ignored.
ignore_errors (
Sequence[Union[type,str]]) –A list of exception class names that shouldn’t be sent to Sentry.
Errors that are an instance of these exceptions or a subclass of them, will be filtered out before they’re sent to Sentry.
By default, all errors are sent.
max_breadcrumbs (
int) –This variable controls the total amount of breadcrumbs that should be captured.
This defaults to 100, but you can set this to any number.
However, you should be aware that Sentry has a maximum payload size and any events exceeding that payload size will be dropped.
attach_stacktrace (
bool) –When enabled, stack traces are automatically attached to all messages logged.
Stack traces are always attached to exceptions; however, when this option is set, stack traces are also sent with messages.
This option means that stack traces appear next to all log messages.
Grouping in Sentry is different for events with stack traces and without. As a result, you will get new groups as you enable or disable this flag for certain events.
data_collection (
Optional[DataCollectionUserOptions]) –Structured configuration controlling what data integrations collect automatically. Omitted fields use their defaults (most categories are collected, with the sensitive denylist scrubbing values). Restrict collection per category (user identity, cookies, HTTP headers/bodies, query params, generative AI inputs/outputs, stack frame variables, source context).
Example:
sentry_sdk.init( dsn="...", data_collection={"user_info": False, "http_bodies": []}, )
See https://docs.sentry.io/platforms/python/configuration/options/#data_collection for more details.
add_full_stack (
bool) –When capturing errors, Sentry stack traces typically only include frames that start the moment an error occurs.
But if the add_full_stack option is enabled (set to True), all frames from the start of execution will be included in the stack trace sent to Sentry.
max_stack_frames (
Optional[int]) – This option limits the number of stack frames that will be captured when add_full_stack is enabled.This option can be used to supply a server name.
When provided, the name of the server is sent along and persisted in the event.
For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
project_root (
Optional[str]) –The full path to the root directory of your application.
The project_root is used to mark frames in a stack trace either as being in your application or outside of the application.
A list of string prefixes of module names that belong to the app.
This option takes precedence over in_app_exclude.
Sentry differentiates stack frames that are directly related to your application (“in application”) from stack frames that come from other packages such as the standard library, frameworks, or other dependencies.
The application package is automatically marked as inApp.
The difference is visible in [sentry.io](https://sentry.io), where only the “in application” frames are displayed by default.
A list of string prefixes of module names that do not belong to the app, but rather to third-party packages.
Modules considered not part of the app will be hidden from stack traces by default.
This option can be overridden using in_app_include.
max_request_body_size (
str) –This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values:
never: Request bodies are never sent.
small: Only small request bodies will be captured. The cutoff for small depends on the SDK (typically 4KB).
medium: Medium and small requests will be captured (typically 10KB).
always: The SDK will always capture the request body as long as Sentry can make sense of it.
Please note that the Sentry server [limits HTTP request body size](https://develop.sentry.dev/sdk/ expected-features/data-handling/#variable-size). The server always enforces its size limit, regardless of how you configure this option.
max_value_length (
Optional[int]) –The number of characters after which the values containing text in the event payload will be truncated.
WARNING: If the value you set for this is exceptionally large, the event may exceed 1 MiB and will be dropped by Sentry.
ca_certs (
Optional[str]) – A path to an alternative CA bundle file in PEM-format.send_client_reports (
bool) –Set this boolean to False to disable sending of client reports.
Client reports allow the client to send status reports about itself to Sentry, such as information about events that were dropped before being sent.
integrations (
Sequence[Integration]) –List of integrations to enable in addition to auto-enabling integrations (overview).
This setting can be used to override the default config options for a specific auto-enabling integration or to add an integration that is not auto-enabled.
disabled_integrations (
Optional[Sequence[Union[Integration,type[Integration]]]]) –List of integrations that will be disabled.
This setting can be used to explicitly turn off specific auto-enabling integrations (list) or default integrations.
auto_enabling_integrations (
bool) –Configures whether auto-enabling integrations (configuration) should be enabled.
When set to False, no auto-enabling integrations will be enabled by default, even if the corresponding framework/library is detected.
default_integrations (
bool) –Configures whether default integrations should be enabled.
Setting default_integrations to False disables all default integrations as well as all auto-enabling integrations, unless they are specifically added in the integrations option, described above.
before_send (
Optional[Callable[[Event,Dict[str,Any]],Optional[Event]]]) –This function is called with an SDK-specific message or error event object, and can return a modified event object, or null to skip reporting the event.
This can be used, for instance, for manual PII stripping before sending.
By the time before_send is executed, all scope data has already been applied to the event. Further modification of the scope won’t have any effect.
before_breadcrumb (
Optional[Callable[[Dict[str,Any],Dict[str,Any]],Optional[Dict[str,Any]]]]) –This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope.
When nothing is returned from the function, the breadcrumb is dropped.
To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
The callback typically gets a second argument (called a “hint”) which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
transport (
Union[Transport,Type[Transport],None]) –Switches out the transport used to send events.
How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication.
transport_queue_size (
int) – The maximum number of events that will be queued before the transport is forced to flush.When set, a proxy can be configured that should be used for outbound requests.
This is also used for HTTPS requests unless a separate https_proxy is configured. However, not all SDKs support a separate HTTPS proxy.
SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the http_proxy environment variable will be picked up.
Configures a separate proxy for outgoing HTTPS requests.
This value might not be supported by all SDKs. When not supported the http-proxy value is also used for HTTPS requests at all times.
proxy_headers (
Optional[Dict[str,str]]) – A dict containing additional proxy headers (usually for authentication) to be forwarded to urllib3’s ProxyManager.shutdown_timeout (
float) –Controls how many seconds to wait before shutting down.
Sentry SDKs send events from a background queue. This queue is given a certain amount to drain pending events. The default is SDK specific but typically around two seconds.
Setting this value too low may cause problems for sending events from command line applications.
Setting the value too high will cause the application to block for a long time for users experiencing network connectivity problems.
Determines whether to keep the connection alive between requests.
This can be useful in environments where you encounter frequent network issues such as connection resets.
Path to the client certificate to use.
If set, supersedes the CLIENT_CERT_FILE environment variable.
Path to the key file to use.
If set, supersedes the CLIENT_KEY_FILE environment variable.
socket_options (
Optional[List[Tuple[int,int,Union[int,bytes]]]]) –An optional list of socket options to use.
These provide fine-grained, low-level control over the way the SDK connects to Sentry.
If provided, the options will override the default urllib3 socket options.
traces_sample_rate (
Optional[float]) –A number between 0 and 1, controlling the percentage chance a given service span will be sent to Sentry.
(0 represents 0% while 1 represents 100%.) Applies equally to all service spans created in the app.
Either this or traces_sampler must be defined to enable tracing.
If traces_sample_rate is 0, this means that no new traces will be created. However, if you have another service (for example a JS frontend) that makes requests to your service that include trace information, those traces will be continued and thus spans will be sent to Sentry.
If you want to disable all tracing you need to set traces_sample_rate=None. In this case, no new traces will be started and no incoming traces will be continued.
trace_lifecycle (
Optional[str]) – Controls how traces are sent. Span streaming is the only supported tracing mode, so the only accepted value is “stream”. Other values are ignored and a warning is logged. This option only exists for backwards compatibility with 2.x and has no effect.traces_sampler (
Optional[Callable[[Dict[str,Any]],Union[float,int,bool]]]) –A function responsible for determining the percentage chance a given service span will be sent to Sentry.
It will automatically be passed information about the service span and the context in which it’s being created, and must return a number between 0 (0% chance of being sent) and 1 (100% chance of being sent).
Can also be used for filtering service spans, by returning 0 for those that are unwanted.
Either this or traces_sample_rate must be defined to enable tracing.
trace_propagation_targets (
Optional[Sequence[str]]) –An optional property that controls which downstream services receive tracing data, in the form of a sentry-trace and a baggage header attached to any outgoing HTTP requests.
The option may contain a list of strings or regex against which the URLs of outgoing requests are matched.
If one of the entries in the list matches the URL of an outgoing request, trace data will be attached to that request.
String entries do not have to be full matches, meaning the URL of a request is matched when it _contains_ a string provided through the option.
If trace_propagation_targets is not provided, trace data is attached to every outgoing request from the instrumented client.
functions_to_trace (
Sequence[Dict[str,str]]) –An optional list of functions that should be set up for tracing.
For each function in the list, a span will be created when the function is executed.
Functions in the list are represented as strings containing the fully qualified name of the function.
This is a convenient option, making it possible to have one central place for configuring what functions to trace, instead of having custom instrumentation scattered all over your code base.
To learn more, see the Custom Instrumentation documentation.
enable_backpressure_handling (
bool) –When enabled, a new monitor thread will be spawned to perform health checks on the SDK.
If the system is unhealthy, the SDK will keep halving the traces_sample_rate set by you in 10 second intervals until recovery.
This down sampling helps ensure that the system stays stable and reduces SDK overhead under high load.
This option is enabled by default.
enable_db_query_source (
bool) – When enabled, the source location will be added to database queries.db_query_source_threshold_ms (
int) –The threshold in milliseconds for adding the source location to database queries.
The query location will be added to the query for queries slower than the specified threshold.
enable_http_request_source (
bool) – When enabled, the source location will be added to outgoing HTTP requests.http_request_source_threshold_ms (
int) –The threshold in milliseconds for adding the source location to an outgoing HTTP request.
The request location will be added to the request for requests slower than the specified threshold.
custom_repr (
Optional[Callable[...,Optional[str]]]) –A custom repr function to run while serializing an object.
Use this to control how your custom objects and classes are visible in Sentry.
Return a string for that repr value to be used or None to continue serializing how Sentry would have done it anyway.
profiler_mode (
Optional[Literal['thread','gevent','unknown']])profile_lifecycle (
Literal['manual','trace'])auto_session_tracking (
bool)before_send_log (
Optional[Callable[[Log,Dict[str,Any]],Optional[Log]]]) – An optional function to modify or filter out logs before they’re sent to Sentry. Any modifications to the log in this function will be retained. If the function returns None, the log will not be sent to Sentry.strict_trace_continuation (
bool) –If set to True, the SDK will only continue a trace if the org_id of the incoming trace found in the baggage header matches the org_id of the current Sentry client and only if BOTH are present.
If set to False, consistency of org_id will only be enforced if both are present. If either are missing, the trace will be continued.
The client’s organization ID is extracted from the DSN or can be set with the org_id option. If the organization IDs do not match, the SDK will start a new trace instead of continuing the incoming one. This is useful to prevent traces of unknown third-party services from being continued in your application.
org_id (
Optional[str]) – An optional organization ID. The SDK will try to extract if from the DSN in most cases but you can provide it explicitly for self-hosted and Relay setups. This value is used for trace propagation and for features like strict_trace_continuation.before_send_span (
Optional[Callable[[SpanJSON,Dict[str,Any]],Optional[SpanJSON]]]) – An optional function to modify spans before they’re sent to Sentry. Modifications to the span’s attributes and name will be retained. Unlikebefore_send_logandbefore_send_metric, spans cannot be dropped by returning None.ignore_spans (
Optional[list[Union[str,Pattern[str],IgnoreSpansContext]]]) – A sequence of span-matching rules. Matching spans are ignored._experiments (
Experiments) – Dictionary of experimental, opt-in features that are not yet stable.
Capturing Data#
- sentry_sdk.api.capture_event(event, hint=None, scope=None, **scope_kwargs)[source]#
Alias for
sentry_sdk.Scope.capture_event()Captures an event.
Merges given scope data and calls
sentry_sdk.client._Client.capture_event().- Parameters:
event (
Event) – A ready-made event that can be directly sent to Sentry.hint (
Optional[Dict[str,Any]]) – Contains metadata about the event that can be read from before_send, such as the original exception object or a HTTP request object.scope (
Optional[Any]) – An optionalsentry_sdk.Scopeto apply to events. The scope and scope_kwargs parameters are mutually exclusive.scope_kwargs (
Any) – Optional data to apply to event. For supported **scope_kwargs seesentry_sdk.Scope.update_from_kwargs(). The scope and scope_kwargs parameters are mutually exclusive.
- Return type:
- Returns:
An event_id if the SDK decided to send the event (see
sentry_sdk.client._Client.capture_event()).
- sentry_sdk.api.capture_exception(error=None, scope=None, **scope_kwargs)[source]#
Alias for
sentry_sdk.Scope.capture_exception()Captures an exception.
- Parameters:
error (
Union[BaseException,tuple[Type[BaseException],BaseException,Optional[TracebackType]],tuple[None,None,None],None]) – An exception to capture. If None, sys.exc_info() will be used.scope (
Optional[Any]) – An optionalsentry_sdk.Scopeto apply to events. The scope and scope_kwargs parameters are mutually exclusive.scope_kwargs (
Any) – Optional data to apply to event. For supported **scope_kwargs seesentry_sdk.Scope.update_from_kwargs(). The scope and scope_kwargs parameters are mutually exclusive.
- Return type:
- Returns:
An event_id if the SDK decided to send the event (see
sentry_sdk.client._Client.capture_event()).
- sentry_sdk.api.capture_message(message, level=None, scope=None, **scope_kwargs)[source]#
Alias for
sentry_sdk.Scope.capture_message()Captures a message.
- Parameters:
message (
str) – The string to send as the message.level (
Optional[Literal['fatal','critical','error','warning','info','debug']]) – If no level is provided, the default level is info.scope (
Optional[Any]) – An optionalsentry_sdk.Scopeto apply to events. The scope and scope_kwargs parameters are mutually exclusive.scope_kwargs (
Any) – Optional data to apply to event. For supported **scope_kwargs seesentry_sdk.Scope.update_from_kwargs(). The scope and scope_kwargs parameters are mutually exclusive.
- Return type:
- Returns:
An event_id if the SDK decided to send the event (see
sentry_sdk.client._Client.capture_event()).
Enriching Events#
- sentry_sdk.api.add_attachment(bytes=None, filename=None, path=None, content_type=None)[source]#
Alias for
sentry_sdk.Scope.add_attachment()Adds an attachment to future events sent from this scope.
The parameters are the same as for the
sentry_sdk.attachments.Attachmentconstructor.- Return type:
- sentry_sdk.api.add_breadcrumb(crumb=None, hint=None, **kwargs)[source]#
Alias for
sentry_sdk.Scope.add_breadcrumb()Adds a breadcrumb.
- sentry_sdk.api.set_context(key, value)[source]#
Alias for
sentry_sdk.Scope.set_context()Binds a context at a certain key to a specific value.
- Return type:
- sentry_sdk.api.set_extra(key, value)[source]#
Alias for
sentry_sdk.Scope.set_extra()Sets an extra key to a specific value.
- Return type:
- sentry_sdk.api.set_level(value)[source]#
Alias for
sentry_sdk.Scope.set_level()Sets the level for the scope.
- sentry_sdk.api.set_tag(key, value)[source]#
Alias for
sentry_sdk.Scope.set_tag()Sets a tag for a key to a specific value.
- sentry_sdk.api.set_user(value)[source]#
Alias for
sentry_sdk.Scope.set_user()Sets a user for the scope.
- Return type:
Performance Monitoring#
- sentry_sdk.api.trace(func=None, *, name=None, attributes=None, active=True)[source]#
Decorator to start a span around a function call in streaming mode.
This decorator automatically creates a new span when the decorated function is called, and finishes the span when the function returns or raises an exception.
- Parameters:
func (Callable or None) – The function to trace. When used as a decorator without parentheses, this is the function being decorated. When used with parameters (e.g.,
@trace(op="custom"), this should be None.name (str or None) – The human-readable name/description for the span. If not provided, defaults to the function name. This provides more specific details about what the span represents (e.g., “GET /api/users”, “process_user_data”).
attributes (dict[str, Any] or None) – A dictionary of key-value pairs to add as attributes to the span. Attribute values must be strings, integers, floats, or booleans. These attributes provide additional context about the span’s execution.
active (bool) – Controls whether spans started while this span is running will automatically become its children. That’s the default behavior. If you want to create a span that shouldn’t have any children (unless provided explicitly via the parent_span argument), set this to False.
- Returns:
When used as
@trace, returns the decorated function. When used as@trace(...)with parameters, returns a decorator function.- Return type:
Callable or decorator function
Example:
import sentry_sdk # Simple usage with default values @sentry_sdk.trace def process_data(): # Function implementation pass # With custom parameters @sentry_sdk.trace( name="Get user data", attributes={"postgres": True} ) def make_db_query(sql): # Function implementation pass
- sentry_sdk.api.continue_trace(incoming)[source]#
Continue a trace from headers or environment variables.
This function sets the propagation context on the scope. Any span started in the updated scope will belong under the trace extracted from the provided propagation headers or environment variables.
continue_trace() doesn’t start any spans on its own. Use the start_span() API for that.
- Return type:
- sentry_sdk.api.new_trace()[source]#
Reset the propagation context, forcing a new trace.
This function sets the propagation context on the scope. Any span started in the updated scope will start its own trace.
new_trace() doesn’t start any spans on its own. Use the start_span() API for that.
- Return type:
- sentry_sdk.api.get_current_span(scope=None)[source]#
Returns the currently active span on the scope, otherwise None.
- Return type:
Optional[Span]
- sentry_sdk.api.start_span(**kwargs)[source]#
Alias for
sentry_sdk.Scope.start_span()Start a span.
The span’s parent, unless provided explicitly via the parent_span argument, will be the current active span, if any. If there is none, this span will become the root of a new span tree. If you explicitly want this span to be top-level without a parent, set parent_span=None.
start_span()can either be used as context manager or you can use the span object it returns and explicitly end it viaspan.end(). The following is equivalent:import sentry_sdk with sentry_sdk.start_span(name="My Span"): # do something # The span automatically finishes once the ``with`` block is exited
import sentry_sdk span = sentry_sdk.start_span(name="My Span") # do something span.end()
To continue a trace from another service, call sentry_sdk.continue_trace() prior to creating a top-level span.
- Parameters:
name (str) – The name to identify this span by.
attributes ("Optional[Attributes]") – Key-value attributes to set on the span from the start. These will also be accessible in the traces sampler.
parent_span ("Optional[Span]") – A span instance that the new span should consider its parent. If not provided, the parent will be set to the currently active span, if any. If set to None, this span will become a new root-level span.
active (bool) – Controls whether spans started while this span is running will automatically become its children. That’s the default behavior. If you want to create a span that shouldn’t have any children (unless provided explicitly via the parent_span argument), set this to False.
links ("Optional[list[SpanLink]]") – Spans to link the span to, without making them its parent, e.g. in other traces. More can be added with span.add_link() or span.add_links().
- Returns:
The span that has been started.
- Return type:
Span
Distributed Tracing#
Client Management#
- sentry_sdk.api.is_initialized()[source]#
- Return type:
Added in version 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.
- sentry_sdk.api.get_client()[source]#
Alias for
sentry_sdk.Scope.get_client():rtype:BaseClientAdded in version 2.0.0.
Returns the currently used
sentry_sdk.Client. This checks the current scope, the isolation scope and the global scope for a client. If no client is available asentry_sdk.client.NonRecordingClientis returned.
Managing Scope (advanced)#
- sentry_sdk.api.new_scope()[source]#
-
Added in version 2.0.0.
Context manager that forks the current scope and runs the wrapped code in it. After the wrapped code is executed, the original scope is restored.
Example Usage:
import sentry_sdk with sentry_sdk.new_scope() as scope: scope.set_tag("color", "green") sentry_sdk.capture_message("hello") # will include `color` tag. sentry_sdk.capture_message("hello, again") # will NOT include `color` tag.