Enhance NodeExporterPath JSON option to pass additional node_exporter arguments#30
Enhance NodeExporterPath JSON option to pass additional node_exporter arguments#30derbear merged 6 commits intoalgorand:masterfrom jecassis:master
Conversation
tsachiherman
left a comment
There was a problem hiding this comment.
The reasoning here seems valid, however, I would have the code so that if any of the parsed values contains web.listen-address or web.telemetry-path, we would omit the ones that we try to set.
There was a problem hiding this comment.
Moreover, since the code now generates a list of arguments that are going to be sent to the node_exporter process, I think it would be best if we've have a function that would parse the input argument ( i.e. NodeExporterPath ), and generate a list of argument that would be sent to node exporter.
Then, once we have this function and using it, we can create a series of unit tests that would validate that the passed parameters are constructed correctly in various test cases.
As an alternative, consider modifying the node_exporter process itself and add support for environment variable. The fact that the node_exporter doesn't have an environment variable that can be set to override the default parameters force all the derived applications to have "special" cases.
I think this the direction I'd probably explore with a filter for the existing ones.
My suspicion is that doing so adds an additional level of obfuscation/abstraction and in addition one could also make the same request to |
Karmastic
left a comment
There was a problem hiding this comment.
This seems good to me.
tsachiherman
left a comment
There was a problem hiding this comment.
Units tests and updated functionality looks great.
Just one small request :
Within the unit test, can you use the require package instead of using the t.Errorf directly ?
When adding the require package, please place it in a separate line-separated “group”, like in the rest of the unit tests.
|
Much cleaner to use the require package. Had never used it before :) The changes are in flight. And the separate line grouping is enforced by gofmt, so it goes without saying. |
tsachiherman
left a comment
There was a problem hiding this comment.
Looks great @jecassis, thank you for your contribution !
Fix exceed map lookups in local state access in TEAL
Example from config.json:
"NodeExporterPath": "./node_exporter --collector.systemd"
This should result in the following process being launched when metrics are enabled:
./node_exporter --collector.systemd --web.listen-address=:9100 --web.telemetry-path=/metrics
As of now the changing the NodeExporterPath as above causes StartProcess to error and does not launch node_exporter.