From d0b24d1b41cd41ac545ffd2fb99cbd69344d7dba Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Mon, 20 Jul 2026 13:18:51 +0500 Subject: [PATCH] Do not instrument http+unix:// requests --- src/dstack/_internal/server/utils/otel/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dstack/_internal/server/utils/otel/utils.py b/src/dstack/_internal/server/utils/otel/utils.py index d78385862..d1c786aff 100644 --- a/src/dstack/_internal/server/utils/otel/utils.py +++ b/src/dstack/_internal/server/utils/otel/utils.py @@ -105,7 +105,10 @@ def _instrument(app: FastAPI, engine: AsyncEngine) -> None: SQLAlchemyInstrumentor().instrument(engine=engine.sync_engine) _register_db_span_renaming(engine.sync_engine) HTTPXClientInstrumentor().instrument() - RequestsInstrumentor().instrument() + # unixsocket calls to runners should not be instrumented: every runner + # tunnel has a unique socket path that becomes the net.peer.name metric + # attribute, so the SDK would accumulate state for an unbounded number of series. + RequestsInstrumentor().instrument(excluded_urls=r"http\+unix://") if settings.OTEL_METRICS_ENABLED: SystemMetricsInstrumentor(config=_PROCESS_METRICS_CONFIG).instrument()