opsgenie.sendAlert() function

    The opsgenie.sendAlert() function sends an alert message to Opsgenie.

    *Function type: Output*

    Opsgenie API URL. Defaults to https://api.opsgenie.com/v2/alerts.

    *Data type: String*

    apiKey

    Required Opsgenie API authorization key.

    *Data type: String*

    message

    Required Alert message text. 130 characters or less.

    *Data type: String*

    alias

    *Data type: String*

    Alert description. 15000 characters or less.

    *Data type: String*

    priority

    Opsgenie alert priority. Valid values include:

    • P1
    • P2
    • P3 (default)
    • P4
    • P5

    *Data type: String*

    responders

    List of responder teams or users. Use the user: prefix for users and teams: prefix for teams.

    *Data type: Array of strings*

    tags

    Alert tags.

    Alert entity used to specify the alert domain.

    *Data type: String*

    actions

    List of actions available for the alert.

    *Data type: Array of strings*

    details

    Additional alert details. Must be a JSON-encoded map of key-value string pairs.

    *Data type: String*

    visibleTo

    List of teams and users the alert will be visible to without sending notifications. Use the prefix for users and teams: prefix for teams.

    *Data type: Array of strings*

    Examples

    Send the last reported status to a Opsgenie
    1. import "influxdata/influxdb/secrets"
    2. import "contrib/sranka/opsgenie"
    3. apiKey = secrets.get(key: "OPSGENIE_APIKEY")
    4. lastReported =
    5. from(bucket: "example-bucket")
    6. |> range(start: -1m)
    7. |> last()
    8. |> findRecord(fn: (key) => true, idx: 0)
    9. opsgenie.sendAlert(
    10. apiKey: apiKey,
    11. message: "Disk usage is: ${lastReported.status}.",
    12. alias: "example-disk-usage",
    13. responders: ["user:john@example.com", "team:itcrowd"]

    Package author and maintainer