freckle-app 1.15.0.0 → 1.15.0.1
raw patch · 6 files changed
+23/−8 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−1
- freckle-app.cabal +1/−1
- library/Freckle/App/Database.hs +6/−2
- library/Freckle/App/Kafka/Producer.hs +3/−1
- library/Freckle/App/Memcached/Client.hs +7/−2
- package.yaml +1/−1
CHANGELOG.md view
@@ -1,4 +1,8 @@-## [_Unreleased_](https://github.com/freckle/freckle-app/compare/v1.15.0.0...main)+## [_Unreleased_](https://github.com/freckle/freckle-app/compare/v1.15.0.1...main)++## [v1.15.0.1](https://github.com/freckle/freckle-app/compare/v1.15.0.0...v1.15.0.1)++- Set `service.name` when tracing Database, Memcached, and Kafka functions. ## [v1.15.0.0](https://github.com/freckle/freckle-app/compare/v1.14.0.0...v1.15.0.0)
freckle-app.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: freckle-app-version: 1.15.0.0+version: 1.15.0.1 license: MIT license-file: LICENSE maintainer: Freckle Education
library/Freckle/App/Database.hs view
@@ -44,6 +44,7 @@ import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as BS8 import qualified Data.ByteString.Lazy as BSL+import qualified Data.HashMap.Strict as HashMap import Data.Pool import qualified Data.Text as T import Database.Persist.Postgresql@@ -71,6 +72,7 @@ import Freckle.App.Stats (HasStatsClient) import qualified Freckle.App.Stats as Stats import OpenTelemetry.Instrumentation.Persistent+import qualified OpenTelemetry.Trace as Trace import System.Process.Typed (proc, readProcessStdout_) import UnliftIO.Concurrent (threadDelay) import UnliftIO.IORef@@ -140,7 +142,7 @@ pool <- asks getSqlPool gauge <- Stats.lookupGauge Stats.dbConnections let- hooks = setAlterBackend defaultSqlPoolHooks $ wrapSqlBackend mempty+ hooks = setAlterBackend defaultSqlPoolHooks $ wrapSqlBackend dbAttributes -- Setting the SqlPoolHooks for metrics collection: -- You may be wondering if this code contains a "double-decrement" bug, because -- perhaps when an exception occurs, both runAfter and runOnException are@@ -172,8 +174,10 @@ runOnException hooks conn mi e } Stats.withGauge Stats.dbEnqueuedAndProcessing $- inSpan "runDB" clientSpanArguments $+ inSpan "runDB" (clientSpanArguments {Trace.attributes = dbAttributes}) $ runSqlPoolWithExtensibleHooks action pool Nothing hooks'+ where+ dbAttributes = HashMap.fromList [("service.name", "database")] runDBSimple :: (HasSqlPool app, MonadUnliftIO m, MonadReader app m)
library/Freckle/App/Kafka/Producer.hs view
@@ -150,7 +150,9 @@ producerSpanArguments { Trace.attributes = HashMap.fromList- [("topic", Trace.toAttribute $ unTopicName prTopic)]+ [ ("service.name", "kafka")+ , ("topic", Trace.toAttribute $ unTopicName prTopic)+ ] } produceKeyedOnAsync
library/Freckle/App/Memcached/Client.hs view
@@ -62,7 +62,11 @@ inSpan "cache.get" clientSpanArguments- { Trace.attributes = HashMap.fromList [("key", Trace.toAttribute k)]+ { Trace.attributes =+ HashMap.fromList+ [ ("service.name", "memcached")+ , ("key", Trace.toAttribute k)+ ] } -- | Set a value to expire in the given seconds@@ -89,7 +93,8 @@ clientSpanArguments { Trace.attributes = HashMap.fromList- [ ("key", Trace.toAttribute k)+ [ ("service.name", "memcached")+ , ("key", Trace.toAttribute k) , ("value", byteStringToAttribute v) , ("expiration", Trace.toAttribute expiration) ]
package.yaml view
@@ -1,5 +1,5 @@ name: freckle-app-version: 1.15.0.0+version: 1.15.0.1 maintainer: Freckle Education category: Utils github: freckle/freckle-app