-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Differentiate running a function with test=True
or mock=True
#28
Comments
Hello @julioz, Thanks for your insights.
This is by design, respecting Salt "success" result. Why do you want to exclude or differentiate them? Can you elaborate on your usecase? Note: adding more labels to identify dry-run from mock from prod will quickly increase the metric cardinality, especially when health-minion feature is enabled. So I would like to perfectly understand the need to find the most appropriate implementation. |
While keeping track of success/failure on automatic job runs (e.g highstate) we still would like to give engineers to possibility to iterate on their Salt states while developing, while not poisoning our metric reporting, especially because we have alerts set for when failure rate is above a certain threshold. So the use-case would be for an engineer iterating on a new state (or refactor) and potentially using
Totally understand - what I was thinking of was some sort of flag we can pass to the exporter so that it ignores dry-run executions, or alternatively expose a separate metric with potentially less granularity (i.e no minion labels, etc) counting how many dry-run executions were read from the event bus. In other words, passing that flag would allow for us to split what's a dry-run and what's not, in terms of success/failed state executions. |
Thanks for the details, crystal clear. I had not thought about this usecase because we do dev on dev/preprod instances, so production metrics are never poisoned by development. I'll probably go for an option to ignore dry-run and/or mock. To be transparent, I won't probably be able to work on this until beginning of June as I am on vacation :) |
Sounds great, let me know when you work on it and I'm happy to review the proposed metric. Thanks for the help! |
hi @julioz, I have added the option to ignore test and mock. See the dry_run_mock_exclusion branch. It is not merged yet as I am working on a rework of the configuration system of the exporter. |
Awesome, thank you very much. Looking forward to trying this out when the release is ready 👏 |
Hi @julioz, The feature is included in the new v0.6.0 release! 🎉 |
When running a function in test mode (for example
salt <target> state.highstate test=True
), we get metrics reported as if the function was executed successfully/failing according to the result:It would be benefitial to differentiate running states in test mode, mock mode or "production".
The text was updated successfully, but these errors were encountered: