From 325a66ba3d94bbeefe06a149d8a80d011ddd5d1b Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:48:08 +0530 Subject: [PATCH] cleanup --- .../sttp/tapir/server/metrics/Metric.scala | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/server/core/src/main/scala/sttp/tapir/server/metrics/Metric.scala b/server/core/src/main/scala/sttp/tapir/server/metrics/Metric.scala index c229f6bf24..8c90e9fb3b 100644 --- a/server/core/src/main/scala/sttp/tapir/server/metrics/Metric.scala +++ b/server/core/src/main/scala/sttp/tapir/server/metrics/Metric.scala @@ -63,31 +63,4 @@ object MetricLabels { } ) ) - - /** Default labels for OpenTelemetry-compliant metrics, as recommended here: - * https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#http-server - * - * - `http.request.method` - HTTP request method (e.g., GET, POST). - * - `path` - The request path or route template. - * - `http.response.status_code` - HTTP response status code (200, 404, etc.). - */ - lazy val OpenTelemetryAttributes: MetricLabels = MetricLabels( - forRequest = List( - "http.request.method" -> { case (_, req) => req.method.method }, - "url.scheme" -> { case (_, req) => req.uri.scheme.getOrElse("unknown") }, - "path" -> { case (ep, _) => ep.showPathTemplate(showQueryParam = None) } - ), - forResponse = List( - "http.response.status_code" -> { - case Right(r) => r.code.code.toString - // Default to 500 for exceptions - case Left(_) => "500" - }, - "error.type" -> { - case Left(ex) => ex.getClass.getSimpleName - case Right(_) => "" - - } - ) - ) }