diff --git a/libs/arcade-serve/arcade_serve/fastapi/telemetry.py b/libs/arcade-serve/arcade_serve/fastapi/telemetry.py index aee48a73..77357b4a 100644 --- a/libs/arcade-serve/arcade_serve/fastapi/telemetry.py +++ b/libs/arcade-serve/arcade_serve/fastapi/telemetry.py @@ -20,6 +20,8 @@ from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.semconv._incubating.attributes import deployment_attributes from opentelemetry.semconv.attributes import service_attributes +EXCLUDED_URLS = "/worker/health" + class ShutdownError(Exception): pass @@ -53,7 +55,7 @@ class OTELHandler: self._init_tracer() self._init_metrics() self._init_logging(self.log_level) - FastAPIInstrumentor().instrument_app(app) + FastAPIInstrumentor().instrument_app(app, excluded_urls=EXCLUDED_URLS) def _init_tracer(self) -> None: self._tracer_provider = TracerProvider(resource=self.resource) diff --git a/libs/arcade-serve/pyproject.toml b/libs/arcade-serve/pyproject.toml index 093110d8..b61593d1 100644 --- a/libs/arcade-serve/pyproject.toml +++ b/libs/arcade-serve/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "arcade-serve" -version = "3.1.1" +version = "3.1.2" description = "Arcade Serve - Serving infrastructure for Arcade tools and workers" readme = "README.md" license = {text = "MIT"} diff --git a/libs/tests/worker/test_telemetry.py b/libs/tests/worker/test_telemetry.py index f772de4f..b45b0c2f 100644 --- a/libs/tests/worker/test_telemetry.py +++ b/libs/tests/worker/test_telemetry.py @@ -50,7 +50,7 @@ def test_init_with_enable_true( assert handler._log_processor is not None # Verify that FastAPIInstrumentor is used - mock_instrumentor.return_value.instrument_app.assert_called_once_with(app) + mock_instrumentor.return_value.instrument_app.assert_called_once_with(app, excluded_urls="/worker/health") @patch("arcade_serve.fastapi.telemetry.logging")