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
Set current index on first call of config/index #997
Conversation
Fix the "orphaned indicies" problem described in riemann#957. Allows a Riemann config to make multiple calls to riemann.config/index with predictable results, both on initial load and after a reload. Without this change, multiple calls are OK after reload or explicit apply, but create orphan indices on initial load. Closes: riemann#957
I'd be chuffed to get some feedback on this proposal (after the current |
Without looking at the implementation, my opinion is that this would be okay for 99% of use-cases. But what about the other 1%? |
I would like to do something to make this easier for new users. I proposed a few solutions in #957, and maybe folks would be interested in exploring solutions in that issue. This PR is the solution that I prefer, because it doesn't add any new functions, or require more documentation to explain the subtleties of Even James' book, which is an exceptionally useful resource for new users, doesn't capture all the nuances. It reads that
In reality,
That's a lot to reason about, and it trips people up. In particular, it trips up people who have their Riemann configuration spread over multiple files, if more than one of them, quite innocently, says: (let [index (index)]) That's a mutating call (sometimes), but how does the user know that? In practice, they don't know. They just end up with broken expiry, because they have reapers attached to indices that aren't attached to cores. Thankfully, my production config has a decent test suite, so it discovered that expiry stopped working, but I'm sure there are Riemann users who don't use the (amazing) test functionally, especially if they're new. All in all, I'm arguing in favour of behaviour that is less subtle, and gives results that are more consistent when users do things that they see as examples in the documentation and The Art of Monitoring. 1. https://artofmonitoring.com/TheArtOfMonitoring_sample.pdf Page 23-24. |
I pretty much agree to what you're saying, but I'll leave the decision to more experienced riemann contributors. |
Fix the "orphaned indices" problem described in #957.
Allows a Riemann config to make multiple calls to
riemann.config/index
with predictable results, both on initial load and after a reload.
Without this change, multiple calls are OK after reload or explicit
apply, but create orphan indices on initial load.
Closes: #957