Skip to content

Commit

Permalink
Reduce telemetry timeout from 5 to 1 second (#337)
Browse files Browse the repository at this point in the history
We had an unreasonably high timeout - reducing to a more acceptable one
  • Loading branch information
tatiana authored Jan 5, 2025
1 parent c53c093 commit 61eaf07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dagfactory/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TELEMETRY_URL = "https://astronomer.gateway.scarf.sh/dag-factory/{telemetry_version}/{dagfactory_version}/{airflow_version}/{python_version}/{platform_system}/{platform_machine}/{event_type}/{status}/{dag_hash}/{task_count}"
TELEMETRY_VERSION = "v2"
TELEMETRY_TIMEOUT = 5.0
TELEMETRY_TIMEOUT = 1.0
4 changes: 2 additions & 2 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_emit_usage_metrics_is_unsuccessful(mock_httpx_get, caplog):
is_success = telemetry.emit_usage_metrics(sample_metrics)
mock_httpx_get.assert_called_once_with(
f"""https://astronomer.gateway.scarf.sh/dag-factory/v2/0.2.0a1/2.10.1/3.11/darwin/amd64/dag_run/success/d151d1fa2f03270ea116cc7494f2c591/3""",
timeout=5.0,
timeout=1.0,
follow_redirects=True,
)
assert not is_success
Expand All @@ -86,7 +86,7 @@ def test_emit_usage_metrics_fails(mock_httpx_get, caplog):
is_success = telemetry.emit_usage_metrics(sample_metrics)
mock_httpx_get.assert_called_once_with(
f"""https://astronomer.gateway.scarf.sh/dag-factory/v2/0.2.0a1/2.10.1/3.11/darwin/amd64/dag_run/success/d151d1fa2f03270ea116cc7494f2c591/3""",
timeout=5.0,
timeout=1.0,
follow_redirects=True,
)
assert not is_success
Expand Down

0 comments on commit 61eaf07

Please sign in to comment.