sensu-plugins / sensu-plugins-opsgenie

Sensu plugins for OpsGenie
http://sensu-plugins.io
MIT License
4 stars 24 forks source link

Supply better description field when creating OpsGenie alert #34

Open Castaglia opened 6 years ago

Castaglia commented 6 years ago

Currently, when calling the OpsGenie Alert API to create an alert, the Sensu handler looks in the JSON configuration (from client and/or check) for a description field, e.g.:

  "opsgenie": {
    "description": "...."
    ...
  }

And only if that description value is present, will that value be included in the OpsGenie alert.

I would like to have the check output be used as that description value by default, rather than having to explicitly configure the description value a priori.

This would also make for a shorter "message" field, which has a limit of 130 characters, per the OpsGenie docs. In our case, our Sensu check outputs can be quite long (with URLs and such), leading to field truncation. We can move that check output out from the "message" field to the "description" field (15000 character limit), and avoid truncation issues.