S
Slack notifier
Outputs & exporters availablePost the run summary and threshold breaches to a Slack webhook.
$ loadr plugin install slack-notifier
# Post a single end-of-run summary to Slack, driven by the
# `loadr-plugin-slack-notifier` native OUTPUT plugin.
#
# An output plugin follows the same start / on_snapshot / finish lifecycle as
# the built-in exporters, but this one ignores the sample stream entirely: it
# acts only in `finish(summary)`, rendering the run's pass/fail verdict, the p95
# of `http_req_duration`, the `http_req_failed` error rate and a line per
# threshold, then POSTing that one message to a Slack incoming webhook. The
# transport is pure hyper + hyper-rustls — no Slack SDK — so nothing beyond the
# webhook URL and outbound HTTPS is required. Because it only acts at the end,
# it adds no per-request overhead and never touches the hot path.
#
# Pair it with a streaming output (json, prometheus, ...) when you also want the
# full time series; slack-notifier is purely the end-of-run heads-up.
#
# Build + install the plugin, then run:
# cargo build -p loadr-plugin-slack-notifier --release
# mkdir -p dist && cp plugins/loadr-plugin-slack-notifier/plugin.toml dist/ \
# && cp target/release/libloadr_plugin_slack_notifier.so dist/
# loadr plugin install dist
# SLACK_WEBHOOK_URL=https://hooks.slack.com/services/... \
# loadr run examples/plugins/slack-notifier.yaml
name: slack-notify
description: Post a run summary and threshold verdict to a Slack incoming webhook
defaults:
http:
base_url: https://api.example.com
scenarios:
browse:
executor: ramping-vus
stages:
- { target: 20, duration: 30s }
- { target: 20, duration: 2m }
- { target: 0, duration: 30s }
flow:
- request: { name: list, url: /api/v1/items }
- request:
name: detail
url: /api/v1/items/1
checks: [ { type: status, equals: 200 } ]
outputs:
# Resolve `slack-notifier` by name from the plugins dir (after
# `loadr plugin install`).
- type: plugin
name: slack-notifier
config:
# Required. A Slack incoming webhook URL is a credential — supply it per
# run from the environment, never commit it to the plan.
webhook_url: ${env.SLACK_WEBHOOK_URL}
thresholds:
http_req_failed: [ "rate<0.01" ]
http_req_duration: [ "p(95)<250" ]
A real run: install from the signed index, then watch the plugin work.
A runtime plugin, never in the binary
Installing pulls a per-platform driver from the signed index, verifies its SHA-256 and checks its ABI before it ever loads. Remove it any time with loadr plugin remove slack-notifier.