k6-operator
k6-operator copied to clipboard
Add notification support
The operator should be able to send notifications upon starting and finishing test runs. To get a lot of options with little work, we should use https://github.com/containrrr/shoutrrr.
Configuration of notifications should be done by deploying a notification CR. Some kind of draft proposal of how this could look:
apiVersion: k6.io/v1alpha1
kind: K6Notification
metadata:
name: k6-notification
spec:
start:
- some://shoutrrr/url
finish:
- some://shoutrrr/url
error:
- some://shoutrrr/url
@simskij Are we only looking for start, finish, error? Or are we looking for some other possible events? I'm not sure what all of the different states of a test are?
Some additional input on this issue was here: https://community.k6.io/t/does-handlesummary-works-when-running-k6-in-distributed-mode/2532
Using shoutrrr, or some other go notification library (or apprise if you prefer to interface with python), in the operator to send notifications would be a decent low-effort start. What I'm thinking (or was thinking at least) is:
Start of test
- Where the results will be sent (if anywhere)
- Amount of runners/parallelism
- Which script (k8s ref is probably enough) was executed
- Which nodes the load generators was scheduled to
- Timing for when the generators went from paused to running
End of test
- When it completed
- Amount of successful runner jobs
- Amount of failed runner jobs
- Where the results were sent (if anywhere)
Notifying on the actual k6 metrics is likely best left to k6 itself.