s12v/newrelic-elasticsearch

Current Cluster Status in NewRelic

tylerturk opened this issue · 7 comments

I have the plugin running on both an ES 2.3 and ES 5.1 installation, and I'm not able to see the actual cluster health status (green, yellow, or red) in NR. How do I get access to this and set up an alert condition for when the health changes? Thanks!

Following some API call examples, I do see that this data is being transmitted to NR:

curl -sH "X-Api-Key:${APIKEY}" -X GET "https://api.newrelic.com/v2/components/.../metrics/data.json" -d "names[]=Component/V1/ClusterStats/Status/IsRed[bool]&values=max_value&from=2017-01-09T22:30:38+00:00&to=2017-01-09T22:31:38+00:00"  | jq
{
  "metric_data": {
    "from": "2017-01-09T22:30:38+00:00",
    "to": "2017-01-09T22:31:38+00:00",
    "metrics_not_found": [],
    "metrics_found": [
      "Component/V1/ClusterStats/Status/IsRed[bool]"
    ],
    "metrics": [
      {
        "name": "Component/V1/ClusterStats/Status/IsRed[bool]",
        "timeslices": [
          {
            "from": "2017-01-09T22:30:00+00:00",
            "to": "2017-01-09T22:31:00+00:00",
            "values": {
              "max_value": 1
            }
          }
        ]
      }
    ]
  }
}

I don't see a way to set an alert or view the current status in the UI though.

After doing some digging, it looks like you may have to edit the plugin UI to add the IsRed and IsYellow states as summary metrics to alert off of.

https://docs.newrelic.com/docs/plugins/developing-plugins/structuring-your-plugin/creating-summary-metrics-plugins

@s12v Hey! Is there a chance you'd be able to add those data points to the NR UI? From what it sounds like, it should be a pretty quick change in the NR portal. Thanks!

Bumping this. Would be super useful to see the cluster health.

s12v commented

@tylerturk, I've added "Red status", could you please check?

I have actually stopped running my own elasticsearch cluster and handed it off to another team at work. @kylejohnson may be your best bet. 👍

I've actually now verified that the status is there. There's some awkwardness with the value returned being non-whole sometimes (partial red error status for a bool), but it's easy enough to alert on if value > 0.