-
Notifications
You must be signed in to change notification settings - Fork 214
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
Improve logging documentation of configs #1217
Improve logging documentation of configs #1217
Conversation
- - StdoutSK | ||
- text | ||
|
||
# this is probably a bug of parsing, cannot enforce cgBindAddrPrometheus = Nothing |
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 something I cannot go through :
so when I put hasPrometheus:
or when I omit it at all to specify this option I end up with:
cgBindAddrPrometheus = Just ("127.0.0.1",12799)
When I hasPrometheus: ["",0]
I end up with
cgBindAddrPrometheus = Just ("",0)
which is wrong (it should be validated). And it is expected to have cgBindAddrPrometheus = Nothing
BTW. it is inconsistent with example configuration specified here : https://github.com/input-output-hk/iohk-monitoring-framework/blob/bea0e079fc32ed316ce352d17d14199a680e3f6c/iohk-monitoring/test/config.yaml
When we put hasPrometheus: 12799
we end up with parsing error
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.
I'd suggest to open an issue on the iohk-monitoring-framework. Fixing this is not part of our scope, but reporting it is :)
- KatipBK | ||
|
||
# more options which can be passed as key-value pairs: | ||
options: |
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 needed in order to have set :
cgMapSubtrace = fromList [("#messagecounters.monitoring",NoTrace),("#messagecounters.ekgview",NoTrace),("#messagecounters.aggregation",NoTrace),("#messagecounters.graylog",NoTrace),("#messagecounters.katip",NoTrace),("#messagecounters.switchboard",NoTrace)]
but it also sets :
cgOptions = fromList [("mapSubtrace",fromList [("#messagecounters.monitoring",Object (fromList [("subtrace",String "NoTrace")])),("#messagecounters.ekgview",Object (fromList [("subtrace",String "NoTrace")])),("#messagecounters.aggregation",Object (fromList [("subtrace",String "NoTrace")])),("#messagecounters.graylog",Object (fromList [("subtrace",String "NoTrace")])),("#messagecounters.katip",Object (fromList [("subtrace",String "NoTrace")])),("#messagecounters.switchboard",Object (fromList [("subtrace",String "NoTrace")]))])],
which is maybe as it should be. BUT, it is expected in empty configuration that cgOptions = fromList []
So it is inconsistent in such a sense, That empty is set like : https://github.com/input-output-hk/iohk-monitoring-framework/blob/master/iohk-monitoring/src/Cardano/BM/Configuration/Model.lhs#L543
and then on top of it is https://github.com/input-output-hk/iohk-monitoring-framework/blob/1ebe57df3a76a8ae4e3b5a31a9b85132f71534fc/iohk-monitoring/src/Cardano/BM/Configuration/Static.lhs#L26
So it behaves differently when yaml setting and in the code.
a79f7d2
to
84f0c6f
Compare
It seems like it will be difficult for us to test and document the entire log config format, and that is really a job for the iohk-monitoring team. The main use for this |
describe "initTracer" $ do | ||
it "no settings" $ do | ||
defaultConfig <- getCG <$> defaultConfigStdout | ||
let fp = "../../specifications/logging/empty.yaml" |
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.
[change required]
Use (</>)
from System.FilePath
instead of hard-coded separators.
Why
Hard-coded path don't play well with cross-compiled code :s, so, always rely on platform-agnostic combinator like (</>)
to combine paths.
- - StdoutSK | ||
- text | ||
|
||
# this is probably a bug of parsing, cannot enforce cgBindAddrPrometheus = Nothing |
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.
I'd suggest to open an issue on the iohk-monitoring-framework. Fixing this is not part of our scope, but reporting it is :)
Hmmm. @paweljakubas , the goal for #961 I believe is simply to get some degree of documentation on our side. Pointing to some existing documentation / examples on the iohk-monitoring-framework would probably be sufficient. |
closing in favor of #1253 |
Issue Number
#961
Overview
defaultConfigStdout
from iohk-monitoring-framework is calledinitTracer
with Nothing from cli is calledComments
In order to test do :