-
Notifications
You must be signed in to change notification settings - Fork 10
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
Sbd dump gatherer #156
Sbd dump gatherer #156
Conversation
778b3e9
to
f01f463
Compare
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.
Hey @nelsonkopliku ! thanks for this, after some thought I think you took the right path by changing the gatherer to use data also from the SBDconfig (instead of the mess that it would have been to implement the dependency as I originally suggested)
Btw, is the output right?
I did:
^^/W/t/agent >>> ./trento-agent facts gather --gatherer sbd_dump ^(sbd-dump-gatherer+154) 15:06:06
INFO[2022-12-19 15:06:31] Using config file: /home/rtorrero/.config/trento/agent.yaml
INFO[2022-12-19 15:06:31] loading plugins
INFO[2022-12-19 15:06:31] Starting sbd_dump facts gathering process
INFO[2022-12-19 15:06:31] Starting SBD config Facts gathering
INFO[2022-12-19 15:06:31] Requested sbd_dump facts gathered
INFO[2022-12-19 15:06:31] Gathered fact for "sbd_dump" with argument "":
INFO[2022-12-19 15:06:31] {
"Name": "",
"CheckID": "",
"Value": {
"Value": {
"/dev/vdb": {
...
Why do we have a nested Value
?
Apart from that, consider in a future PR adding support for retrieving specific keys using arguments (rather than the whole map). We have done this in other gatherers and I think it might be a good standard to adopt for gatherers in general.
@rtorrero thanks for the review.
That's the internal representation of different types of values that can be returned as facts, and that's suppported by a bit of polymorphism here https://github.com/trento-project/agent/blob/main/pkg/factsengine/entities/fact_value.go |
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 find the usage of other gatherers dependency a big smell.
I would get the devices in a plain way, using the cluster.LoadSbdConfig
function and getting the key from it.
Less dependency and leaner code.
Besides that, some minor nitpick
true, we already discussed this, vacations finished frying the last working part of my brain 😄 |
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.
Hey @nelsonkopliku ,
Thank you for the changes. The code looks much better now in my opinion.
Have a look on the quoted thing in the SBD_DEVICE
I commented. If that works, we are ready to go
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.
@nelsonkopliku
I was not expecting the test this way. I would expect a new test in the gatherer itself, as using the LoadSbdConfig
funtion is a internal tech detail.
Anyway, I see that it works, so feel free to merge if you want.
Follows up #74 and enables porting of checks
msgwait
timeout value is two times the watchdog timeoutA little sanitization of the keys has been applied to simplify usage of the result at expression level (ie
Timeout (watchdog)
becomestimeout_watchdog
)Doc added here trento-project/wanda#137