-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move tracers to .yaml
files
#447
Conversation
@@ -324,38 +352,27 @@ instance FromJSON ViewMode where | |||
-- which verbosity to the log output. | |||
data TraceOptions = TraceOptions | |||
{ traceVerbosity :: !TracingVerbosity | |||
, traceBlockFetchClient :: !Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fragile. Currently if you add a tracer, you would need to make sure that NodeConfiguration
's FromJSON
instance "aligns" with TraceOptions
.
Potential solution: Create a data type isomorphic to bool for each tracer. I'd prefer a more elegant solution to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you split this type, you should be able to use Generic FromJSON, and have a nicer config format. Something like this:
data TraceOptions = TraceOptions
{ traceVerbosity :: !TracingVerbosity
, traceEnable :: !TraceEnable
}
data TraceEnable = TraceEnable
{ traceBlockFetchClient :: !Bool
, traceBlockFetchDecisions :: !Bool
, traceBlockFetchProtocol :: !Bool
, ...
}
Then the YAML file could look like:
tracing:
verbosity: brief
enable:
- BlockFetchClient: false
- BlockFetchDecisions: false
- BlockFetchProtocol: false
- ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvl the plan so far seems to be having the tracers formatted in the yaml file as follows:
(#443 (comment))
TraceBlockFetchClient:
Enabled: True
MinSeverity: Debug
Verbosity: MaximumVerbosity
Splitting TraceOptions
doesn't alleviate the potential to mix up of tracers if the FromJSON
instance of NodeConfiguration
and TraceOptions
records aren't aligned. The only way I can see to secure this is to implement a series of sum types per tracer eg:
data TraceBlockFetchClientStatus = TraceBlockFetchClientEnabled | TraceBlockFetchClientDisabled
Failing with:
Need to update the generation of the config |
9c4a9e3
to
f2a9151
Compare
95d9fb2 should probably be reverted as part of this PR. |
99b0cd0
to
5c58e38
Compare
@@ -25,11 +25,6 @@ let | |||
"--signing-key ${cfg.signingKey}"}" | |||
"${lib.optionalString (cfg.delegationCertificate != null) | |||
"--delegation-certificate ${cfg.delegationCertificate}"}" | |||
"--tracing-verbosity-${cfg.tracingVerbosity}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tracingVerbosity
option definition could be removed too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbgi removed. This should pass ci now. Once it does are we good to merge: input-output-hk/iohk-nix#303
5c58e38
to
bad484c
Compare
303: Add tracers to default log configuration r=disassembler a=Jimbo4350 Tracing options are being moved to the configuration `.yaml` files (IntersectMBO/cardano-node#447). Co-authored-by: Samuel Leathers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
447: Move tracers to `.yaml` files r=disassembler a=Jimbo4350 Specifying the tracers on the command line is cumbersome and the consensus is to move to them to the configuration `.yaml` files. Relevant: #443 Co-authored-by: Jordan Millar <[email protected]>
bors r- |
Canceled |
Don't merge yet. I need to re-point |
bad484c
to
6bbe08c
Compare
6bbe08c
to
6197f90
Compare
bors r+ |
447: Move tracers to `.yaml` files r=Jimbo4350 a=Jimbo4350 Specifying the tracers on the command line is cumbersome and the consensus is to move to them to the configuration `.yaml` files. Relevant: #443 Co-authored-by: Jordan Millar <[email protected]>
474: Move tracers to config `.yaml` files r=Jimbo4350 a=Jimbo4350 Last PR was accidentally closed (#447) Co-authored-by: Jordan Millar <[email protected]>
Specifying the tracers on the command line is cumbersome and the consensus is to move to them to the configuration
.yaml
files.Relevant: #443