Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iohk-monitoring/iohk-monitoring.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: iohk-monitoring
version: 0.2.1.1
version: 0.2.1.2
synopsis: logging, benchmarking and monitoring framework
-- description:
license: Apache-2.0
Expand Down
5 changes: 4 additions & 1 deletion iohk-monitoring/src/Cardano/BM/Backend/Switchboard.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Data.Aeson (FromJSON, ToJSON)
import Data.Maybe (isJust)
import Data.Text (Text)
import qualified Data.Text.IO as TIO
import GHC.Conc (labelThread, myThreadId)
import GHC.IO.Exception (BlockedIndefinitelyOnSTM)
import qualified Katip as K
import System.IO (stderr)
Expand Down Expand Up @@ -234,7 +235,9 @@ realizeSwitchboard cfg = do
res <- mapM processItem nlis
when (and res) $ qProc
in
Async.async qProc
Async.async $ do
myThreadId >>= flip labelThread "Switchboard dispatcher (iohk-monitoring)"
qProc

#ifdef PERFORMANCE_TEST_QUEUE
let qSize = 1000000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0
name: lobemo-backend-aggregation
version: 0.1.0.2
version: 0.1.0.3
synopsis: provides a backend implementation to aggregate traced values
-- description:
homepage: https://github.com/input-output-hk/iohk-monitoring-framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Data.Aeson (FromJSON, ToJSON)
import qualified Data.HashMap.Strict as HM
import Data.Text (Text, pack)
import qualified Data.Text.IO as TIO
import GHC.Conc (labelThread, myThreadId)
import System.IO (stderr)

import Cardano.BM.Backend.ProcessQueue (processQueue)
Expand Down Expand Up @@ -147,7 +148,9 @@ spawnDispatcher :: Configuration
spawnDispatcher conf aggMap aggregationQueue basetrace =
let trace = Trace.appendName "#aggregation" basetrace
in
Async.async $ qProc trace aggMap
Async.async $ do
myThreadId >>= flip labelThread "Aggregation dispatcher (lobemo-backend-aggregation)"
qProc trace aggMap
where
{-@ lazy qProc @-}
qProc trace aggregatedMap =
Expand Down
2 changes: 1 addition & 1 deletion plugins/backend-ekg/lobemo-backend-ekg.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0
name: lobemo-backend-ekg
version: 0.2.0.0
version: 0.2.0.1
synopsis: provides a backend implementation to EKG
-- description:
homepage: https://github.com/input-output-hk/iohk-monitoring-framework
Expand Down
5 changes: 4 additions & 1 deletion plugins/backend-ekg/src/Cardano/BM/Backend/EKGView.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Data.String (fromString)
import Data.Text (Text, pack, stripPrefix)
import qualified Data.Text.IO as TIO
import Data.Version (showVersion)
import GHC.Conc (labelThread, myThreadId)

import System.IO (stderr)
import qualified System.Metrics.Gauge as Gauge
Expand Down Expand Up @@ -344,7 +345,9 @@ spawnDispatcher :: Configuration
-> Trace.Trace IO a
-> IO (Async.Async ())
spawnDispatcher config evqueue _sbtrace ekgtrace =
Async.async $ qProc
Async.async $ do
myThreadId >>= flip labelThread "Dispatcher EKGView (lobemo-backend-ekg)"
qProc
where
{-@ lazy qProc @-}
qProc :: IO ()
Expand Down
9 changes: 6 additions & 3 deletions plugins/backend-ekg/src/Cardano/BM/Backend/Prometheus.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Data.Text (Text)
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8)
import Data.Text.Read (double)
import GHC.Conc (labelThread, myThreadId)
import GHC.Generics
import Network.HTTP.Types (status200)
import qualified Network.Wai as Wai
Expand Down Expand Up @@ -72,12 +73,14 @@ instance A.ToJSON Number where

spawnPrometheus :: Wai.Server -> Warp.HostPreference -> Int -> Maybe Text -> IO (Async.Async ())
spawnPrometheus ekg host port prometheusOutput =
Async.async $ Warp.runSettings settings site

Async.async $ do
myThreadId >>= flip labelThread "Prometheus (lobemo-backend-ekg)"
Warp.runSettings settings site

where
settings :: Warp.Settings
settings = Warp.setPort port . Warp.setHost host $ Warp.defaultSettings

site :: Wai.Application
site _request respond = do
-- We ignore the request and simple respond with the data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0
name: lobemo-backend-monitoring
version: 0.1.0.2
version: 0.1.0.3
synopsis: provides a backend implementation for monitoring
-- description:
homepage: https://github.com/input-output-hk/iohk-monitoring-framework
Expand Down Expand Up @@ -76,4 +76,3 @@ test-suite tests
void,
yaml, libyaml
ghc-options: -Wall -Werror

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Data.Maybe (catMaybes)
import Data.Text (Text, pack)
import qualified Data.Text.IO as TIO
import GHC.Clock (getMonotonicTimeNSec)
import GHC.Conc (labelThread, myThreadId)
import System.IO (stderr)

import Cardano.BM.Backend.LogBuffer
Expand Down Expand Up @@ -159,7 +160,9 @@ spawnDispatcher :: TBQ.TBQueue (Maybe (LogObject a))
-> Monitor a
-> IO (Async.Async ())
spawnDispatcher mqueue config sbtrace monitor =
Async.async (initMap >>= qProc)
Async.async (do
myThreadId >>= flip labelThread "Monitoring dispatcher (lobemo-backend-monitoring)"
initMap >>= qProc)
where
{-@ lazy qProc @-}
qProc state =
Expand Down
Loading