From c14985a707632e6e19206b883d3c97a4b4be2803 Mon Sep 17 00:00:00 2001 From: Douglas Voet Date: Fri, 16 Feb 2024 11:09:56 -0500 Subject: [PATCH] null default route --- .../workbench/sam/api/SamRequestContextDirectives.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala index dfbeec5a1..664bee483 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/SamRequestContextDirectives.scala @@ -180,9 +180,11 @@ object AkkaHttpServerAttributesGetter extends HttpServerAttributesGetter[HttpReq override def getUrlQuery(request: HttpRequest): String = request.uri.query().toString() - /** Defaults to the path of the request. Overridden by the `addTelemetry` directive. + /** Defaults to the null. Overridden by the `addTelemetry` directive. This defaults to null because the route is used in metrics and we need to prevent a + * cardinality explosion. If we defaulted to the uri path, then any request with path parameters would default to a unique route until overridden by + * `addTelemetry` which might not happen in the case of errors or bugs. */ - override def getHttpRoute(request: HttpRequest): String = getUrlPath(request) + override def getHttpRoute(request: HttpRequest): String = null override def getHttpRequestMethod(request: HttpRequest): String = request.method.value