-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Report if index is hidden in index stats #18706
Report if index is hidden in index stats #18706
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
|
f487f0c
to
22de4c2
Compare
Pinging @elastic/integrations-services (Team:Services) |
Pinging @elastic/stack-monitoring (Stack monitoring) |
22de4c2
to
c07c160
Compare
💔 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
|
Settings struct { | ||
Index struct { | ||
Hidden string `json:"hidden"` | ||
} `json:"index"` |
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.
why not Hidden bool
, or Index IndexSettings json:"index"
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, let me try the hybrid solution next.
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.
c07c160
to
87b73dd
Compare
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/index
metricset 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.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues