Skip to content

Commit edf41aa

Browse files
committed
chore: allow apigateway proxy config through env vars
1 parent ffa7bf6 commit edf41aa

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sentry/conf/server.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def env(
371371
# so that responses aren't modified after Content-Length is set, or have the
372372
# response modifying middleware reset the Content-Length header.
373373
# This is because CommonMiddleware Sets the Content-Length header for non-streaming responses.
374-
APIGW_ASYNC = os.environ.get("SENTRY_ASYNC_APIGW", "").lower() in ("1", "true", "y", "yes")
374+
APIGW_ASYNC = os.environ.get("SENTRY_APIGW_ASYNC", "").lower() in ("1", "true", "y", "yes")
375375
APIGW_MIDDLEWARE = (
376376
"sentry.hybridcloud.apigateway_async.middleware.ApiGatewayMiddleware"
377377
if APIGW_ASYNC
@@ -3183,9 +3183,9 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
31833183
}
31843184
# Used in tests to skip forwarding relay paths to a region silo that does not exist.
31853185
APIGATEWAY_PROXY_SKIP_RELAY = False
3186-
APIGATEWAY_PROXY_MAX_CONCURRENCY = 100
3187-
APIGATEWAY_PROXY_MAX_FAILURES = 100
3188-
APIGATEWAY_PROXY_FAILURE_WINDOW = 60
3186+
APIGATEWAY_PROXY_MAX_CONCURRENCY = int(os.environ.get("SENTRY_APIGW_PROXY_MAX_CONCURRENCY", 100))
3187+
APIGATEWAY_PROXY_MAX_FAILURES = int(os.environ.get("SENTRY_APIGW_PROXY_MAX_FAILURES", 100))
3188+
APIGATEWAY_PROXY_FAILURE_WINDOW = int(os.environ.get("SENTRY_APIGW_PROXY_FAILURE_WINDOW", 60))
31893189

31903190
# Shared resource ids for accounting
31913191
EVENT_PROCESSING_STORE = "rc_processing_redis"

src/sentry/runner/commands/devserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def devserver(
471471
"SENTRY_SILO_DEVSERVER": "1",
472472
"SENTRY_SILO_MODE": "CONTROL",
473473
"SENTRY_REGION": "",
474-
"SENTRY_ASYNC_APIGW": "true",
474+
"SENTRY_APIGW_ASYNC": "true",
475475
"SENTRY_CONTROL_SILO_PORT": server_port,
476476
"SENTRY_REGION_SILO_PORT": str(ports["region.server"]),
477477
"SENTRY_DEVSERVER_BIND": f"127.0.0.1:{server_port}",

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sentry_sdk
1111

1212
# Set async apigateway as soon as possible
13-
os.environ["SENTRY_ASYNC_APIGW"] = "true"
13+
os.environ["SENTRY_APIGW_ASYNC"] = "true"
1414

1515
# Disable crash recovery server in pytest-rerunfailures. Under xdist, Sentry's
1616
# global socket.setdefaulttimeout(5) causes the server's per-worker recv threads

0 commit comments

Comments
 (0)