mirror of
https://github.com/sartography/spiffworkflow-backend.git
synced 2025-02-24 13:28:31 +00:00
fewer sentry traces
This commit is contained in:
parent
7c01d37f50
commit
c9c7f9d6f9
@ -157,18 +157,29 @@ def configure_sentry(app: flask.app.Flask) -> None:
|
||||
return None
|
||||
return event
|
||||
|
||||
sentry_sample_rate = app.config.get("SENTRY_SAMPLE_RATE")
|
||||
if sentry_sample_rate is None:
|
||||
return
|
||||
sentry_errors_sample_rate = app.config.get("SENTRY_ERRORS_SAMPLE_RATE")
|
||||
if sentry_errors_sample_rate is None:
|
||||
raise Exception("SENTRY_ERRORS_SAMPLE_RATE is not set somehow")
|
||||
|
||||
sentry_traces_sample_rate = app.config.get("SENTRY_TRACES_SAMPLE_RATE")
|
||||
if sentry_traces_sample_rate is None:
|
||||
raise Exception("SENTRY_TRACES_SAMPLE_RATE is not set somehow")
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn=app.config.get("SENTRY_DSN"),
|
||||
integrations=[
|
||||
FlaskIntegration(),
|
||||
],
|
||||
environment=app.config["ENV_IDENTIFIER"],
|
||||
# Set traces_sample_rate to 1.0 to capture 100%
|
||||
|
||||
# sample_rate is the errors sample rate. we usually set it to 1 (100%)
|
||||
# so we get all errors in sentry.
|
||||
sample_rate=float(sentry_errors_sample_rate),
|
||||
|
||||
# Set traces_sample_rate to capture a certain percentage
|
||||
# of transactions for performance monitoring.
|
||||
# We recommend adjusting this value in production.
|
||||
traces_sample_rate=float(sentry_sample_rate),
|
||||
# We recommend adjusting this value to less than 1(00%) in production.
|
||||
traces_sample_rate=float(sentry_traces_sample_rate),
|
||||
|
||||
before_send=before_send,
|
||||
)
|
||||
|
@ -47,7 +47,8 @@ SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME = environ.get(
|
||||
|
||||
# Sentry Configuration
|
||||
SENTRY_DSN = environ.get("SENTRY_DSN", default="")
|
||||
SENTRY_SAMPLE_RATE = environ.get("SENTRY_SAMPLE_RATE", default="1.0")
|
||||
SENTRY_ERRORS_SAMPLE_RATE = environ.get("SENTRY_ERRORS_SAMPLE_RATE", default="1") # send all errors
|
||||
SENTRY_TRACES_SAMPLE_RATE = environ.get("SENTRY_TRACES_SAMPLE_RATE", default="0.01") # send 1% of traces
|
||||
|
||||
SPIFFWORKFLOW_BACKEND_LOG_LEVEL = environ.get(
|
||||
"SPIFFWORKFLOW_BACKEND_LOG_LEVEL", default="info"
|
||||
|
Loading…
x
Reference in New Issue
Block a user