From 482268cb95ed92ff9dab4101e79160c3c08b0d56 Mon Sep 17 00:00:00 2001 From: Douglas Voet Date: Mon, 27 Nov 2023 15:19:30 -0500 Subject: [PATCH] cleanup --- .../dsde/workbench/sam/api/StatusRoutes.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/StatusRoutes.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/StatusRoutes.scala index 85917a05d..ba804af35 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/StatusRoutes.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/api/StatusRoutes.scala @@ -20,8 +20,10 @@ trait StatusRoutes { val statusService: StatusService implicit val executionContext: ExecutionContext - private lazy val checkStatusSuccessCounter = GlobalOpenTelemetry.getMeter("StatusRoutes").counterBuilder("checkStatus-success").build() - private lazy val checkStatusFailureCounter = GlobalOpenTelemetry.getMeter("StatusRoutes").counterBuilder("checkStatus-failure").build() + // lazy to make sure GlobalOpenTelemetry is initialized + private lazy val otelMeter = GlobalOpenTelemetry.getMeter("StatusRoutes") + private lazy val checkStatusSuccessCounter = otelMeter.counterBuilder("checkStatus-success").build() + private lazy val checkStatusFailureCounter = otelMeter.counterBuilder("checkStatus-failure").build() def statusRoutes: server.Route = pathPrefix("status") {