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 level | PagerDuty severity |
---|---|
crit | critical |
warn | warning |
info | info |
ok | info |
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
}
Bug Reports and Feedback
Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation. Submit feedback using one of the following methods:
- Post in the InfluxData Community
- In the InfluxDB UI, click Feedback in the left navigation bar.
- Submit documentation issues to the InfluxDB 2.0 documentation repository.
- Submit InfluxDB issues to the InfluxDB repository.