Update Elasticsearch integrations to support ES 7.x

Description

There are a number of breaking changes in ES 7.x that make it such that our integrations no longer work.

The problems include:

  • Moving the "total" count in the response from a number to an object

  • Index mapping changes

The deep-dive URL for flows fails with:

URL: /opennms/rest/flows/flowGraphUrl?end=1559675530618&exporterNode=1&ifIndex=2&limit=0&start=1559589130618
Repsonse: 500
Failed to execute query: java.lang.UnsupportedOperationException: JsonObject

Exception:
Caused by: java.lang.UnsupportedOperationException: JsonObject
at com.google.gson.JsonElement.getAsLong(JsonElement.java:231) ~[?:?]
at io.searchbox.core.SearchResult.getTotal(SearchResult.java:205) ~[?:?]
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) ~[?:?]
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[?:?]
at org.opennms.netmgt.flows.elastic.ElasticFlowRepository$1.completed(ElasticFlowRepository.java:703) ~[?:?]
at org.opennms.netmgt.flows.elastic.ElasticFlowRepository$1.completed(ElasticFlowRepository.java:697) ~[?:?]
at io.searchbox.client.http.JestHttpClient$DefaultCallback.completed(JestHttpClient.java:267) ~[?:?]
at io.searchbox.client.http.JestHttpClient$DefaultCallback.completed(JestHttpClient.java:246) ~[?:?]

And other features fail to push any data into the indices since the index templates cannot be initialized.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Jesse White July 30, 2019 at 8:27 PM

Jesse White June 4, 2019 at 7:20 PM

Response for the ES query to count the flows returns the following in ES 7.1.x:

Fixed

Details

Assignee

Reporter

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created June 4, 2019 at 7:18 PM
Updated July 31, 2019 at 7:12 PM
Resolved July 31, 2019 at 7:12 PM