Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name

v0.0.6 · public · Published over 3 years ago

Asset Definition
Release Notes
Release Assets

Core Dependencies Filter


This Sensu Go filter looks for dependencies defined in check and entity annotations and invokes the sensu.CheckDependencies query expression to determine if any of the defined dependecies are in a non-OK state.


The coreDependencies function implemented by this library is intended as proof-of-concept reproduction of the Sensu Core dependencies filter.

In Sensu Core the dependencies were expressed as an array. For this implementation I've chosen to use comma separated values.

Example: check dependencies

Given you have a check called https-health which monitors your website's /health endpoint, you want to suppress alerts from the https-cert check when https-health is in a non-OK state:

type: CheckConfig
api_version: core/v2
  name: https-cert
    dependencies: https-health
  command: check-https-cert.rb --url
  - pagerduty
  interval: 60
  - website

Provided that the pagerduty handler has been configured as shown below in Usage examples, the dependencies annotation with the value https-health will prevent alerts from https-cert from reaching pagerduty when https-health is not OK.

Example: entity dependencies

Given you have an agent running in a remote site with unreliable network link. Sometimes the ethernet cable falls out of port 5 on the switch, other times the ISP link fails. And yet you soldier on. It's fine.

You want to suppress alerts from any check this agent runs when either
a. the remote-site-link is in a non-OK state
b. the state of check port5 on entity remote-switch is in a non-OK state (entity/check syntax)

For an agent entity, you can set this in the agent.yml annotations:

# agent.yml
  dependencies: remote-site-link,remote-switch/port5

Or whatever method as appropriate for the entity type or your Sensu version.

Usage examples

Asset Registration

sensuctl asset add sensu/sensu-dependencies-filter -r dependencies-filter

Filter definition

Define an event filter using the coreDependencies function. This function requires the event object as its only argument.

type: EventFilter
api_version: core/v2
  name: dependencies
  namespace: default
  action: allow
  - coreDependencies(event)
  - dependencies-filter

Handler definition

Add the filter to any of your existing handlers. Here's a Pagerduty handler with the above event filter applied:

type: Handler
api_version: core/v2
  name: pagerduty
  namespace: default
  type: pipe
  command: sensu-pagerduty-handler
  timeout: 10
  - sensu-pagerduty-handler
  - dependencies-filter


Inspired by Sensu Core dependencies filter extension.

Are you sure you want to report this asset?

Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.


You must be signed in to report this asset.

Sign In with Github



Either download the source code:

Download Source

Or download the asset definition: