Sensu 传输处理程序定义最大记录数

Sensu transport handler define max record count

我有一些 sensu 指标检查,其中定义了传输处理程序。我的传输是 Redis,我可以看到每个度量周期都有新记录添加到 Redis,但是我想定义最大记录限制或记录 TTL,这样我就不会在 Redis 中存储无休止的度量数据。我怎样才能从处理程序 json 声明中做到这一点?这是我的处理程序定义:

{
  "handlers": {
    "redis_handler": {
      "type": "transport",
      "mutator": "only_check_output",
      "pipe": {
        "type": "direct",
        "name": "example_handler_queue"
      }
    }
  }
}

谢谢

你可以用occurences filter extension来表达,

The occurrences filter will determine if an event occurrence count meets the user defined requirements in the event check definition. Users can specify a minimum number of occurrences before an event will be passed to a handler. Users can also specify a refresh time, in seconds, to reset where recurrences are counted from.