Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name

Asset Definition
Release Notes
Release Assets

Sensu Bonsai Asset
Go Test


Table of Contents


The sensu-grafana-mutator is a Sensu Mutator that parse a label as grafana loki explore url and add to event as grafana_loki_url annotation.

Usage examples

Sensu grafana mutator add grafana_*_url annotations

  sensu-grafana-mutator [flags]
  sensu-grafana-mutator [command]

Available Commands:
  help        Help about any command
  version     Print the version number of this plugin

  -A, --alertmanager-integration-label string           Allow integration from sensu-alertmanager-events plugin (default "sensu-alertmanager-events")
  -D, --grafana-dashboard-suggested string              Suggested Dashboard based on Labels. e. [{"grafana_annotation":"kubernetes_namespace","dashboard_url":"","labels":["namespace"]}]
  -d, --grafana-loki-datasource string                  An Grafana Loki Datasource name. e. -d loki  (default "loki")
  -p, --grafana-loki-explorer-pipeline string           From Sensu Events, choose one label to be parse here. e. {app=eventrouter} |= k8s_id then use -p k8s_id
  -r, --grafana-loki-explorer-range int                 Time range in seconds to create grafana explorer URL (default 300)
  -l, --grafana-loki-explorer-stream-label string       From Grafana Loki streams use label. e. {app=eventrouter} then '-l app'  (default "app")
  -n, --grafana-loki-explorer-stream-namespace string   From Grafana Loki streams use namespace. e. {namespace=ValueFromEvent} then '-n NamespaceLabelName' 
  -s, --grafana-loki-explorer-stream-selector string    From Grafana Loki streams use label. e. {app=eventrouter} then '-s eventrouter'  (default "eventrouter")
  -g, --grafana-url string                              An grafana complete URL. e. 
  -h, --help                                            help for sensu-grafana-mutator

Use "sensu-grafana-mutator [command] --help" for more information about a command.



Using Grafana Explore tab and Grafana Loki as datasource:

  • Search as example: {app="eventrouter"}|= "164c27e81b96bdc8" where "164c27e81b96bdc8" cames from the value from sensu event.label[""].

Then sensu-grafana-mutator should be:

./sensu-grafana-mutator -g -p


It will try to find the label in event.check.Label with name sensu-alertmanager-events and value owner then it will create a grafana loki URL using only namespace in stream. Example: {namespace="Value"}. Only change --alertmanager-integration-label if the sensu-alertmanager-events plugin changed it.


You can include multiples grafana_annotations inside this flag. But we don't have a benchmark about it. Then keep it simple and it will work as expected. We used one example dashboard from kubernete-mixin called kubernetes-compute-resources-namespace-pods.

    "grafana_annotation": "kubernetes_namespace",
    "dashboard_url": "",
    "labels": [

Asset registration

Sensu Assets are the best way to make use of this plugin. If you're not using an asset, please
consider doing so! If you're using sensuctl 5.13 with Sensu Backend 5.13 or later, you can use the
following command to add the asset:

sensuctl asset add betorvs/sensu-grafana-mutator

If you're using an earlier version of sensuctl, you can find the asset on the [Bonsai Asset Index][].

Mutator definition

type: Mutator
api_version: core/v2
  name: sensu-grafana-mutator
  namespace: default
  command: sensu-grafana-mutator -g -p
  - betorvs/sensu-grafana-mutator

Installation from source

The preferred way of installing and deploying this plugin is to use it as an Asset. If you would
like to compile and install the plugin from source or contribute to it, download the latest version
or create an executable script from this source.

From the local path of the sensu-grafana-mutator repository:

go build

Additional notes


For more information about contributing to this plugin, see Contributing.

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: