Alert for derivative on accumulative value

Hi all,

I would like to create an alert if the garbage collection time on a JVM takes longer then 20 seconds over any given minute.

I have created the below query to work out the derivative however I am struggling to work out how to create an alert based on this.

Would appreciate any advice on this.

GET apm-*metric-*/_search
{
  "size": 0,
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "range": {
            "@timestamp": {
              "gte": "now-24h",
              "lt": "now"
            }
          }
        },
        {
          "term": {
             "labels.name": "PS MarkSweep"
          }
        }
      ]
    }
  },  
  "aggs": {
    "hostgroup": {
      "terms": {
         "field": "host.ip",
         "size": 10
      },  
      "aggs": {
        "by_date": {
          "date_histogram": {
            "field": "@timestamp",
            "calendar_interval": "minute"  
          },
          "aggs": {  
            "@timestamp": {
              "max": {
                "field": "@timestamp"
              }
            },                  
            "gctime": {
              "max": {
                "field": "jvm.gc.time"
              }
            },
            "gctime_rate": {
                "derivative": {
                  "buckets_path": "gctime.value"
                }
            }
          }
        }
      }
    }
  }
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.