Skip to content
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

Elasticsearch 5.0 Compatibility #221

Closed
nlowe opened this issue Oct 31, 2016 · 4 comments
Closed

Elasticsearch 5.0 Compatibility #221

nlowe opened this issue Oct 31, 2016 · 4 comments

Comments

@nlowe
Copy link

nlowe commented Oct 31, 2016

As far as I can tell, the only compatibility problems with ES 5.0 is dropping the all parameter from _nodes/stats and renaming hostname to host:

diff --git a/Opserver.Core/Data/Elastic/ElasticCluster.Nodes.cs b/Opserver.Core/Data/Elastic/ElasticCluster.Nodes.cs
index 40b62e7..0eeac57 100644
--- a/Opserver.Core/Data/Elastic/ElasticCluster.Nodes.cs
+++ b/Opserver.Core/Data/Elastic/ElasticCluster.Nodes.cs
@@ -16,7 +16,7 @@ public partial class ElasticCluster
                 var result = (await GetAsync<ClusterNodesInfo>("_nodes").ConfigureAwait(false))?.Prep();
                 if (result == null) return null;

-                var stats = await GetAsync<ClusterNodesStats>("_nodes/stats?all").ConfigureAwait(false);
+                var stats = await GetAsync<ClusterNodesStats>("_nodes/stats").ConfigureAwait(false);
                 if (stats == null) return result;

                 foreach (var s in stats.Nodes)
@@ -279,7 +279,7 @@ public class NodeStats
                 public string Name { get; internal set; }
                 [DataMember(Name = "transport_address")]
                 public string TransportAddress { get; internal set; }
-                [DataMember(Name = "hostname")]
+                [DataMember(Name = "host")]
                 public string Hostname { get; internal set; }
                 [DataMember(Name = "indices")]
                 public IndexStats Indexes { get; internal set; }

Without these changes, most of the node stats show up as unknown, and the status icon next to the cluster name reports 400 errors in the tooltip:

image

@NickCraver
Copy link
Member

Well, this sucks. I've berated them before about changing stuff like this that's a PITA across versions. Monitoring APIs shouldn't be needlessly broken like this.

I'll have to spin up 5.x to test some fixes here, since Opserver must continue to support all versions. Thanks for letting me know exactly what's broken, this is a huge time saver.

NickCraver added a commit that referenced this issue Nov 8, 2016
This fixes the "hostname" => "host" change in v5 only (while supporting
old versions).

Dear elastic, stop breaking shit randomly, please. XOXO, Nick
@NickCraver
Copy link
Member

I have pushed a fix for one half on this, but I'm discussing with the Elastic folks the very unecessary breaking change on the all parameter (which wasn't documented either) over here: elastic/elasticsearch#21410

NickCraver added a commit that referenced this issue Nov 9, 2016
I'm giving up on Elasticsearch giving a fuck about breaking versions.
They don't. Breaks are intentionally not being constrained to major
versions, see Elastic #21410 and #21417 for context.

To support this reasonably, Opserver not just doesn't support pre-v0.90
correctly. If this becomes an issue we'll add it back quickly via a
switch.
@NickCraver
Copy link
Member

@nlowe can you please give latest a try? Elasticsearch 5.0 should work now, but if you see any other breaks I'll open this back and address anything you find.

Thanks!

@nlowe
Copy link
Author

nlowe commented Nov 9, 2016

@NickCraver so far, looks like this fixed it, thanks for the quick turnaround! I'll keep an eye out for any other breakage.

GABeech pushed a commit to GABeech/Opserver that referenced this issue Feb 5, 2017
This fixes the "hostname" => "host" change in v5 only (while supporting
old versions).

Dear elastic, stop breaking shit randomly, please. XOXO, Nick
GABeech pushed a commit to GABeech/Opserver that referenced this issue Feb 5, 2017
I'm giving up on Elasticsearch giving a fuck about breaking versions.
They don't. Breaks are intentionally not being constrained to major
versions, see Elastic #21410 and #21417 for context.

To support this reasonably, Opserver not just doesn't support pre-v0.90
correctly. If this becomes an issue we'll add it back quickly via a
switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants