From b6f82b9320790b4933969f277fe1185a2fa486cc Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Mon, 18 Dec 2023 12:21:36 +1100 Subject: [PATCH 1/2] Adopt new OpenTelemetry HTTP attribute names --- core-webserver-warp/core-webserver-warp.cabal | 6 +++--- core-webserver-warp/lib/Core/Webserver/Warp.hs | 16 ++++++++-------- core-webserver-warp/package.yaml | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core-webserver-warp/core-webserver-warp.cabal b/core-webserver-warp/core-webserver-warp.cabal index c96ffa56..afc1a28e 100644 --- a/core-webserver-warp/core-webserver-warp.cabal +++ b/core-webserver-warp/core-webserver-warp.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: core-webserver-warp -version: 0.2.1.2 +version: 0.3.0.0 synopsis: Interoperability with Wai/Warp description: This is part of a library to help build command-line programs, both tools and longer-running daemons. @@ -24,7 +24,7 @@ license: MIT license-file: LICENSE build-type: Simple tested-with: - GHC == 8.10.7, GHC == 9.2.7, GHC == 9.4.5 + GHC == 8.10.7, GHC == 9.2.7, GHC == 9.4.8 source-repository head type: git diff --git a/core-webserver-warp/lib/Core/Webserver/Warp.hs b/core-webserver-warp/lib/Core/Webserver/Warp.hs index c3e8bc8b..16c59eae 100644 --- a/core-webserver-warp/lib/Core/Webserver/Warp.hs +++ b/core-webserver-warp/lib/Core/Webserver/Warp.hs @@ -208,10 +208,10 @@ loggingMiddleware (context0 :: Context τ) application request sendResponse = do subProgram context1 $ do telemetry - [ metric "request.method" method - , metric "request.path" path - , if nullRope query then metric "request.query" () else metric "request.query" query - , metric "response.status_code" code + [ metric "http.request.method" method + , metric "http.request.path" path + , if nullRope query then metric "http.request.query" () else metric "http.request.query" query + , metric "http.response.status_code" code ] -- actually handle the request @@ -227,10 +227,10 @@ loggingMiddleware (context0 :: Context τ) application request sendResponse = do warn "Trapped internal exception" debug "e" text telemetry - [ metric "request.method" method - , metric "request.path" path - , if nullRope query then metric "request.query" () else metric "request.query" query - , metric "response.status_code" code + [ metric "http.request.method" method + , metric "http.request.path" path + , if nullRope query then metric "http.request.query" () else metric "http.request.query" query + , metric "http.response.status_code" code , metric "error" text ] diff --git a/core-webserver-warp/package.yaml b/core-webserver-warp/package.yaml index c41da0b9..c79946ac 100644 --- a/core-webserver-warp/package.yaml +++ b/core-webserver-warp/package.yaml @@ -1,5 +1,5 @@ name: core-webserver-warp -version: 0.2.1.2 +version: 0.3.0.0 synopsis: Interoperability with Wai/Warp description: | This is part of a library to help build command-line programs, both tools and @@ -15,7 +15,7 @@ license-file: LICENSE author: Andrew Cowie maintainer: Andrew Cowie copyright: © 2021-2023 Athae Eredh Siniath and Others -tested-with: GHC == 8.10.7, GHC == 9.2.7, GHC == 9.4.5 +tested-with: GHC == 8.10.7, GHC == 9.2.7, GHC == 9.4.8 category: System ghc-options: -Wall -Wwarn -fwarn-tabs github: aesiniath/unbeliever From 1d21b74df7213f09ca928aa09e0479e9ed4149a9 Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Mon, 18 Dec 2023 15:10:42 +1100 Subject: [PATCH 2/2] Add prefix to additional telemetry --- core-webserver-warp/lib/Core/Webserver/Router.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-webserver-warp/lib/Core/Webserver/Router.hs b/core-webserver-warp/lib/Core/Webserver/Router.hs index 4c4f0305..bcc37b50 100644 --- a/core-webserver-warp/lib/Core/Webserver/Router.hs +++ b/core-webserver-warp/lib/Core/Webserver/Router.hs @@ -285,7 +285,7 @@ makeApplication trie request sendResponse = do let prefix = intoRope prefix' let remainder = intoRope remainder' telemetry - [ metric "request.route" prefix + [ metric "http.request.route" prefix ] handler prefix remainder request