oci-fn-slack-alert-normalizer

Normalizes noisy alert payloads into a cleaner Slack-friendly incident message.

What it does

The first useful run is a Slack-ready alert that already has the normalized severity, resource, and summary in one stable shape. That makes the repo useful before you wire in a real chat webhook or incident routing layer.

Try it locally

python3 - <<'PY'
import json
from func import normalize_alert
payload = '{"title":"DB CPU High","severity":"ERROR","resourceName":"db-prod-1","message":"CPU above threshold"}'
print(json.dumps(normalize_alert(payload), indent=2))
PY

Example output

{
  "text": "[high] DB CPU High",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*DB CPU High*\nSeverity: `high`\nResource: `db-prod-1`\nCPU above threshold"
      }
    }
  ]
}

Where it helps

Use this when a noisy alert source should become a cleaner chat payload first, whether the next step is Slack delivery, incident triage, or a broader alert-handling workflow.