Exclude health span from telemetry (#697)
This commit is contained in:
parent
bc2b945511
commit
0af13aeab5
3 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in a new issue