Skip to content

Commit

Permalink
Merge #743
Browse files Browse the repository at this point in the history
743: CAD-666 Activate TraceForwarder plugin if needed. r=CodiePP a=denisshevchenko

Issue
-----------

- Currently `TraceForwarder` plugin won't be activated even if corresponding setting is presented in the config.

- This PR **does not result** in breaking changes to upstream dependencies.

Checklist
---------
- [ ] This PR contains all the work required to resolve the linked issue.

- [ ] The work contained has sufficient documentation to describe what it does and how to do it.

- [ ] The work has sufficient tests and/or testing.

- [ ] I have committed clear and descriptive commits. Be considerate as somebody else will have to read these.

- [x] I have added the appropriate labels to this PR.


Co-authored-by: Denis Shevchenko <[email protected]>
  • Loading branch information
iohk-bors[bot] and Denis Shevchenko authored Apr 3, 2020
2 parents d309267 + 49b5f8c commit 7d7f667
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,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
Expand Down
1 change: 1 addition & 0 deletions cardano-config/cardano-config.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ library
, lobemo-backend-aggregation
, lobemo-backend-ekg
, lobemo-backend-monitoring
, lobemo-backend-trace-forwarder
, lobemo-scribe-systemd
, network
, network-mux
Expand Down
6 changes: 6 additions & 0 deletions cardano-config/src/Cardano/Config/Logging.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ extra-deps:
- plugins/backend-aggregation
- plugins/backend-ekg
- plugins/backend-monitoring
- plugins/backend-trace-forwarder
- plugins/scribe-systemd
- tracer-transformers

Expand Down

0 comments on commit 7d7f667

Please sign in to comment.