Dagweave catalog

Raise an Opsgenie alert

opsgenie-alertv1.0.0updated 2026-10-181 version

Create an alert in Opsgenie so the on-call responder is paged. The API key comes from a Kubernetes Secret.

Install v1.0.0

Installs the template into your Argo namespace. The URL is pinned to this version.

kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/opsgenie-alert/1.0.0/template.yaml

Or with the Argo CLI:

argo template create -n argo https://catalog.dagweave.com/api/v1/items/opsgenie-alert/1.0.0/template.yaml

Facts

Category
Notifications
Tags
notifications python
Entrypoint
alert
Template SHA-256
7eda28203c45bbc799afee8dd67f3ddc5e0f56f91d3c2f7188ff47e19d981124
Source
opsgenie-alert at catalog commit 67458f7
API
item document, latest template.yaml

Images and provenance

Every image is pinned by digest, so a rebuilt tag can never change what this version runs.

RepositoryTagDigest
cgr.dev/chainguard/pythonlatest-devsha256:8a5780972067cfba4592b10e786a889807ed876c1100f89410fd0ed4e398992c

Parameters

NameDescriptionDefault
message required Alert title, up to 130 characters.
Example checkout-api error rate above 5%
none
alias Alias that groups repeats of the same alert into one. Leave blank to make every alert separate. empty
api-key-secret-key Key in that Secret that holds the API key. api-key
api-key-secret-name Name of the Kubernetes Secret that holds the Opsgenie API key. opsgenie-api-key
api-url Base URL of the Opsgenie API. Use https://api.eu.opsgenie.com for EU accounts. https://api.opsgenie.com
description Longer explanation shown on the alert. Leave blank for none. empty
priority Priority of the alert, P1 being the most urgent.
One of P1, P2, P3, P4, P5
P3
tags Comma-separated tags.
Example checkout,prod
empty

WorkflowTemplate

Download template.yaml

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: opsgenie-alert
  labels:
    dagweave.io/catalog-item: opsgenie-alert
  annotations:
    dagweave.io/catalog-version: "1.0.0"
    dagweave.io/catalog-category: "Notifications"
spec:
  entrypoint: alert
  templates:
    - name: alert
      inputs:
        parameters:
          - name: message
          - name: description
            default: ""
          - name: priority
            default: "P3"
          - name: alias
            default: ""
          - name: tags
            default: ""
          - name: api-url
            default: "https://api.opsgenie.com"
          - name: api-key-secret-name
            default: "opsgenie-api-key"
          - name: api-key-secret-key
            default: "api-key"
      retryStrategy:
        limit: "2"
        retryPolicy: OnError
        backoff:
          duration: 10s
          factor: "2"
          maxDuration: 2m
      container:
        # cgr.dev/chainguard/python:latest-dev
        image: cgr.dev/chainguard/python@sha256:8a5780972067cfba4592b10e786a889807ed876c1100f89410fd0ed4e398992c
        command: [sh, -c]
        args:
          - |
            set -eu
            python - <<'PY'
            import json, os, sys, urllib.error, urllib.request

            env = os.environ
            body = {"message": env["MESSAGE"], "priority": env["PRIORITY"], "source": "dagweave"}
            for field, key in (("description", "DESCRIPTION"), ("alias", "ALIAS")):
                if env[key]:
                    body[field] = env[key]
            if env["TAGS"]:
                body["tags"] = [t.strip() for t in env["TAGS"].split(",") if t.strip()]
            req = urllib.request.Request(
                env["API_URL"].rstrip("/") + "/v2/alerts",
                data=json.dumps(body).encode(),
                headers={"Content-Type": "application/json", "Authorization": "GenieKey " + env["API_KEY"]},
            )
            try:
                with urllib.request.urlopen(req, timeout=30) as resp:
                    print(resp.status, resp.read().decode())
            except urllib.error.HTTPError as err:
                print(err.code, err.read().decode(), file=sys.stderr)
                sys.exit(1)
            PY
        env:
          - name: MESSAGE
            value: "{{inputs.parameters.message}}"
          - name: DESCRIPTION
            value: "{{inputs.parameters.description}}"
          - name: PRIORITY
            value: "{{inputs.parameters.priority}}"
          - name: ALIAS
            value: "{{inputs.parameters.alias}}"
          - name: TAGS
            value: "{{inputs.parameters.tags}}"
          - name: API_URL
            value: "{{inputs.parameters.api-url}}"
          - name: API_KEY
            valueFrom:
              secretKeyRef:
                name: "{{inputs.parameters.api-key-secret-name}}"
                key: "{{inputs.parameters.api-key-secret-key}}"
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            memory: 256Mi

Version history

Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.

  1. 1.0.0 latest 2026-10-18

    Initial release.

    kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/opsgenie-alert/1.0.0/template.yaml
    argo template create -n argo https://catalog.dagweave.com/api/v1/items/opsgenie-alert/1.0.0/template.yaml

    version document, template.yaml

Run it once

After installing, from the command line.

argo submit -n argo --from workflowtemplate/opsgenie-alert \
  -p message='checkout-api error rate above 5%'

Workflow that references it

A Workflow with the required parameters filled from the examples.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: opsgenie-alert-
spec:
  workflowTemplateRef:
    name: opsgenie-alert
  arguments:
    parameters:
      - name: message
        value: "checkout-api error rate above 5%"

As a step of a larger workflow

steps:
  - - name: opsgenie-alert
      templateRef:
        name: opsgenie-alert
        template: alert