Report if index is hidden in index stats#18706
Report if index is hidden in index stats#18706ycombinator merged 5 commits intoelastic:masterfrom ycombinator:mb-es-xp-index-mark-hidden
Conversation
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
|
Pinging @elastic/integrations-services (Team:Services) |
|
Pinging @elastic/stack-monitoring (Stack monitoring) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
There was a problem hiding this comment.
why not Hidden bool, or Index IndexSettings json:"index"?
There was a problem hiding this comment.
It had to do with the type of index.hidden in the Elasticsearch API's JSON response being a string, e.g. "true", instead of being a JSON boolean, e.g. true. Let me make a commit showing what I tried before this, implementing json.Unmarshaler, then we can decide which implementation we like better.
There was a problem hiding this comment.
Uff, I see. If we would use something like boolstr more often we might consider to provide a package/library with decoding primitives. But here as a standalone single use case within the package I think I prefer to decode into string first. A hybrid solution could be Index struct { Hidden boolstr json:"index" }, but keep IndexSetting{ Hidden bool }. Then you might be able to cast from Index into IndexSetting directly. Using boolstr we see decoding errors directly returned from the JSON decoder if something changes.
There was a problem hiding this comment.
Thanks, let me try the hybrid solution next.
|
CI failures are unrelated. See #19740. |
* Report index hidden setting in index stats * Adding CHANGELOG entry * Use expand_wildcards in tests as well * Using json.Unmarshaler instead * Hybrid approach
What does this PR do?
Enhances the
elasticsearch/indexmetricset to report if an index is hidden or not.Why is it important?
This will allow the Stack Monitoring UI to suitably mark the index in the UI.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues