s12v/newrelic-elasticsearch

does not work with ES 2.0.0-beta2

d1rtym0nk3y opened this issue · 3 comments

I think it crashes out parsing json from /_node/stats

[2015-10-07 10:05:39,451] DEBUG com.newrelic.metrics.publish.binding.Request - ComponentData(es-cluster:me.snov.newrelic-elasticsearch) : Metric: Component/V1/ClusterStats/Indices/Store/Size[bytes], count: 1, value: 3.10953344E9, minValue: 3.10953344E9, maxValue: 3.10953344E9, sumOfSquares: 9.669199E18
[2015-10-07 10:05:39,452] DEBUG com.newrelic.metrics.publish.Agent - Reporting metric: V1/ClusterStats/NumberOfVersionsInCluster
[2015-10-07 10:05:39,453] DEBUG com.newrelic.metrics.publish.binding.Request - ComponentData(es-cluster:me.snov.newrelic-elasticsearch) : Metric: Component/V1/ClusterStats/NumberOfVersionsInCluster[versions], count: 1, value: 1.0, minValue: 1.0, maxValue: 1.0, sumOfSquares: 1.0
SEVERE: An error has occurred
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was NUMBER at line 1 column 2423 path $.nodes..os.load_average
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:200)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:103)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:187)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:103)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196)
    at com.google.gson.Gson.fromJson(Gson.java:810)
    at com.google.gson.Gson.fromJson(Gson.java:748)
    at me.snov.newrelic.elasticsearch.parsers.AbstractParser.parse(Unknown Source)
    at me.snov.newrelic.elasticsearch.parsers.AbstractParser.request(Unknown Source)
    at me.snov.newrelic.elasticsearch.ElasticsearchAgent.pollCycle(Unknown Source)
    at com.newrelic.metrics.publish.Runner$PollAgentsRunnable.run(Runner.java:209)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was NUMBER at line 1 column 2423 path $.nodes..os.load_average
    at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:79)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:103)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:196)
    ... 20 more

The os key from _node/stats looks like this

os: {
    timestamp: 1444213509549,
    load_average: 0.11,
    mem: {
        total_in_bytes: 16659865600,
        free_in_bytes: 6217895936,
        used_in_bytes: 10441969664,
        free_percent: 37,
        used_percent: 63
    },
    swap: {
        total_in_bytes: 8371826688,
        free_in_bytes: 8371826688,
        used_in_bytes: 0
    }
}

Looks like load_average is being reported as a single number, rather than an array of 1m, 5m, 15m values.

I'm also not seeing a key "merge" key in thread_pool

Had this issue here aswell, with 2.x (specifically, 2.1)

s12v commented

Published v2.0.0