From bdb2de797ffe55d31d6d852bb9a998269cb0bd6b Mon Sep 17 00:00:00 2001 From: George Gritsouk <989898+gggritso@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:47:58 -0500 Subject: [PATCH] chore(sdk): Enable query source logging (#60649) Dogfooding the query source feature. Conservatively sets the threshold to 500ms for now. If you're wondering about performance overhead for this, check out info in https://github.com/getsentry/sentry-python/pull/2521 --------- Co-authored-by: Anton Pirker --- src/sentry/conf/server.py | 2 ++ src/sentry/conf/types/sdk_config.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index a4048aacf312fb..b7b3aedd315c32 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -3015,6 +3015,8 @@ def build_cdc_postgres_init_db_volume(settings: Any) -> dict[str, dict[str, str] "debug": True, "send_default_pii": True, "auto_enabling_integrations": False, + "enable_db_query_source": True, + "db_query_source_threshold_ms": 500, } SENTRY_DEV_DSN = os.environ.get("SENTRY_DEV_DSN") diff --git a/src/sentry/conf/types/sdk_config.py b/src/sentry/conf/types/sdk_config.py index c6ae3962d58616..67f93036338adb 100644 --- a/src/sentry/conf/types/sdk_config.py +++ b/src/sentry/conf/types/sdk_config.py @@ -18,6 +18,8 @@ class SdkConfig(TypedDict): before_send_transaction: NotRequired[Callable[[dict[str, Any], object], dict[str, Any]]] profiles_sample_rate: NotRequired[float] profiler_mode: NotRequired[Literal["sleep", "thread", "gevent", "unknown"]] + enable_db_query_source: NotRequired[bool] + db_query_source_threshold_ms: NotRequired[int] _experiments: NotRequired[Any] # TODO