Exclude health span from telemetry (#697)

This commit is contained in:
Sterling Dreyer 2025-11-25 13:03:13 -08:00 committed by GitHub
parent bc2b945511
commit 0af13aeab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -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)

View file

@ -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"}

View file

@ -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")