From 49b5f8cf77b604b09324b3dc231c06110abfee1f Mon Sep 17 00:00:00 2001 From: Denis Shevchenko Date: Tue, 31 Mar 2020 16:59:56 +0400 Subject: [PATCH] Activate TraceForwarder plugin if needed. --- cabal.project | 7 +++++++ cardano-config/cardano-config.cabal | 1 + cardano-config/src/Cardano/Config/Logging.hs | 6 ++++++ stack.yaml | 1 + 4 files changed, 15 insertions(+) diff --git a/cabal.project b/cabal.project index e086790f636..18499f13c7f 100644 --- a/cabal.project +++ b/cabal.project @@ -190,6 +190,13 @@ source-repository-package --sha256: 17brigssa3yjys75izczpwh10m1ai4rja2wgkx95nvm6krizrkh7 subdir: plugins/backend-monitoring +source-repository-package + type: git + location: https://github.com/input-output-hk/iohk-monitoring-framework + tag: 10877fbae54aa7a4c04ae3b5d87c825a4019e9e9 + --sha256: 17brigssa3yjys75izczpwh10m1ai4rja2wgkx95nvm6krizrkh7 + subdir: plugins/backend-trace-forwarder + source-repository-package type: git location: https://github.com/input-output-hk/iohk-monitoring-framework diff --git a/cardano-config/cardano-config.cabal b/cardano-config/cardano-config.cabal index f9c6b5ab7b5..9e9d7ab8cc2 100644 --- a/cardano-config/cardano-config.cabal +++ b/cardano-config/cardano-config.cabal @@ -43,6 +43,7 @@ library , lobemo-backend-aggregation , lobemo-backend-ekg , lobemo-backend-monitoring + , lobemo-backend-trace-forwarder , lobemo-scribe-systemd , network , network-mux diff --git a/cardano-config/src/Cardano/Config/Logging.hs b/cardano-config/src/Cardano/Config/Logging.hs index 81f86729605..f71fa48da52 100644 --- a/cardano-config/src/Cardano/Config/Logging.hs +++ b/cardano-config/src/Cardano/Config/Logging.hs @@ -34,6 +34,7 @@ import Control.Monad.Trans.Except.Extra (catchIOExceptT) import Cardano.BM.Backend.Aggregation (plugin) import Cardano.BM.Backend.EKGView (plugin) import Cardano.BM.Backend.Monitoring (plugin) +import Cardano.BM.Backend.TraceForwarder (plugin) import qualified Cardano.BM.Backend.Switchboard as Switchboard import Cardano.BM.Configuration (Configuration) import qualified Cardano.BM.Configuration as Config @@ -223,6 +224,11 @@ loggingCardanoFeatureInit ver disabled' conf = do Cardano.BM.Backend.EKGView.plugin logConfig trace switchBoard >>= loadPlugin switchBoard + Config.getForwardTo logConfig >>= \forwardTo -> + when (isJust forwardTo) $ + Cardano.BM.Backend.TraceForwarder.plugin logConfig trace switchBoard + >>= loadPlugin switchBoard + Cardano.BM.Backend.Aggregation.plugin logConfig trace switchBoard >>= loadPlugin switchBoard Cardano.BM.Backend.Monitoring.plugin logConfig trace switchBoard diff --git a/stack.yaml b/stack.yaml index d829a96d610..f872bd4c573 100644 --- a/stack.yaml +++ b/stack.yaml @@ -107,6 +107,7 @@ extra-deps: - plugins/backend-aggregation - plugins/backend-ekg - plugins/backend-monitoring + - plugins/backend-trace-forwarder - plugins/scribe-systemd - tracer-transformers