Sentry Dialogs#
qtextra.dialogs.sentry provides two related pieces:
TelemetryOptInDialog, which asks the user whether automatic crash reporting should be enabledinstall_error_monitor, which initializessentry-sdkafter the user opts in
Screenshot#

Example#
Source: examples/dialog_sentry.py
"""Sentry dialog examples."""
from qtpy.QtWidgets import QApplication
from qtextra.config import THEMES
from qtextra.dialogs.sentry.telemetry import TelemetryOptInDialog
app = QApplication([])
widget = TelemetryOptInDialog(with_locals=True)
widget.setMinimumSize(900, 620)
THEMES.apply(widget)
widget.show()
app.exec_()
Install the extra first:
pip install "qtextra[sentry]"
Minimal Setup#
The only required environment variable for crash reporting is:
QTEXTRA_TELEMETRY_SENTRY_DSN: the Sentry DSN for the project that should receive events
Example:
export QTEXTRA_TELEMETRY_SENTRY_DSN="https://<key>@o<org>.ingest.sentry.io/<project>"
Then initialize telemetry from your application once your settings object is available:
from qtextra.dialogs.sentry import install_error_monitor
install_error_monitor(settings)
settings must expose either:
telemetry_enabledandtelemetry_with_locals, orenabledandwith_locals
Optional Environment Variables#
These are not required, but they control the event payload and presentation:
QTEXTRA_TELEMETRY_VERSION: overrides the Sentry release. If omitted,qtextrafalls back to the installed package version or editable git SHA.QTEXTRA_TELEMETRY_PACKAGE: package name used when resolving the release. Defaults toqtextra.QTEXTRA_TELEMETRY_ENVIRONMENT: Sentry environment name. Defaults todesktop.QTEXTRA_TELEMETRY_SHOW_LOCALS:1/trueenables local variables in stack frames by default. Defaults to enabled.QTEXTRA_TELEMETRY_SHOW_HOSTNAME:1/trueallows the machine hostname to be sent. Defaults to disabled.QTEXTRA_TELEMETRY_DEBUG:1/trueenables SDK debug logging.QTEXTRA_TELEMETRY_TRACES_SAMPLE_RATE: trace sampling rate between0.0and1.0. Defaults to1.0.QTEXTRA_TELEMETRY_PROFILES_SAMPLE_RATE: profiling sampling rate between0.0and1.0. Defaults to1.0.
Feedback Configuration#
FeedbackDialog uses Sentry's user-feedback endpoint and needs three
environment variables:
QTEXTRA_TELEMETRY_SENTRY_DSNQTEXTRA_TELEMETRY_ORGANIZATIONQTEXTRA_TELEMETRY_PROJECT
Without all three, the feedback dialog still opens but submission is disabled.
The Sentry integration exposes two dialogs:
TelemetryOptInDialogfor crash-reporting consent and payload previewFeedbackDialogfor manual product feedback submission
Privacy Notes#
The default configuration sends stack traces, package and Qt metadata, and
basic user information that sentry-sdk includes when send_default_pii=True.
qtextra strips absolute file paths from stack frames before sending events.
The biggest debugging tradeoff is QTEXTRA_TELEMETRY_SHOW_LOCALS:
- enable it for better crash diagnosis
- disable it if local variables may contain secrets, document contents, or sensitive paths