-
Notifications
You must be signed in to change notification settings - Fork 796
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
elasticsearchv8 cluster_settings unmarshal error #840
Comments
I can reproduce the problem, on elasticsearch_exporter 1.7.0, with ES 8.12.0 and ES 7.17; By setting only |
It would be really helpful to have an example of the API response from elasticsearch to use in our tests. cluster_settings_test.go has tests to cover the cluster settings endpoint including the watermark metrics. From what I understand, based on the provided error message, the problem is that instead of a string, there is now a nested json object being returned for the watermark metrics. This could be a scenario where we need to use different structs based on elasticsearch version or customize the unmarshal. |
Hello! Here is an extract of a simple
AFAIK, the format/hierarchy is the same with ES8, and haven't changed for ages 🤔 |
Ooooh, by querying it with
ES 8.12:
So we can have an entry in |
I suspect this is the same bug here, but we are seeing it with another metric in the clustersettings collector:
We are on version ES 7.17.6 and the exporter version is 1.7.0. And this is the JSON response to {
"persistent" : {
"cluster" : {
"routing" : {
"allocation" : {
"disk" : {
"watermark" : {
"low" : "92%",
"flood_stage" : "97%",
"high" : "95%"
}
}
}
},
"max_shards_per_node" : "2000"
},
"xpack" : {
"monitoring" : {
"collection" : {
"enabled" : "true"
}
}
}
},
"transient" : { }
} |
Related issue: #509
I was testing elasticsearch_exporter on elasticsearch-8.x and found unmarshal error with
--collector.clustersettings
flag onflat_settings: true
when invoking "GET _cluster/settings" and refactor the struct to match the flat_settings formatExample:
elasticsearch_exporter/collector/cluster_settings.go
Lines 113 to 147 in b24d0ac
elasticsearch_exporter/collector/cluster_settings.go
Line 152 in b24d0ac
The text was updated successfully, but these errors were encountered: