Documentation

pagerduty.severityFromLevel() function

The pagerduty.severityFromLevel() function converts an InfluxDB status level to a PagerDuty severity.

Function type: Transformation

import "pagerduty"

pagerduty.severityFromLevel(
  level: "crit"
)

// Returns "critical"
Status levelPagerDuty severity
critcritical
warnwarning
infoinfo
okinfo

Parameters

level

The InfluxDB status level to convert to a PagerDuty severity.

Data type: String

Function definition

import "strings"

severityFromLevel = (level) => {
  lvl = strings.toLower(v:level)
  sev = if lvl == "warn" then "warning"
      else if lvl == "crit" then "critical"
      else if lvl == "info" then "info"
      else if lvl == "ok" then "info"
      else "error"
  return sev
}

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: