S
S3 archive
Outputs & exporters availableArchive the final report/metrics as an object to S3 (SigV4).
$ loadr plugin install s3-archive
# Archive the finished run report to S3, driven by the `loadr-plugin-s3-archive`
# native OUTPUT plugin.
#
# An output plugin follows the same start / on_snapshot / finish lifecycle as
# the built-in exporters: loadr calls `start(config)` once, hands the plugin a
# metric snapshot roughly once a second during the run, then `finish(summary)`
# at the end. Unlike a live exporter this plugin does NO per-second network
# traffic: it buffers each snapshot in memory and, in `finish`, gzip-compresses
# the accumulated report plus the end-of-run summary and uploads the whole thing
# as a SINGLE SigV4-signed HTTPS PUT to
# `s3://{bucket}/{key_prefix}{run_id}.json.gz`.
#
# The transport is pure hyper + hyper-rustls and a hand-rolled, pure-Rust SigV4
# signer — no AWS SDK, no OpenSSL/C dependency — so nothing beyond AWS
# credentials and outbound HTTPS is required. The uploaded document has the same
# shape as loadr's `--summary-export` JSON, so it feeds straight back into
# `loadr report` or a diff against an earlier run.
#
# Build + install the plugin, then run:
# cargo build -p loadr-plugin-s3-archive --release
# mkdir -p dist && cp plugins/loadr-plugin-s3-archive/plugin.toml dist/ \
# && cp target/release/libloadr_plugin_s3_archive.so dist/
# loadr plugin install dist
# AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... \
# loadr run examples/plugins/s3-archive.yaml
name: s3-archive-export
description: Archive the finished run report as a single object in S3
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 `s3-archive` by name from the plugins dir (after `loadr plugin install`).
- type: plugin
name: s3-archive
config:
# Required. S3 bucket the compressed report is uploaded to.
bucket: my-loadtest-reports
# Prefix prepended to the object key; the run's `run_id` and a `.json.gz`
# suffix complete it (e.g. "runs/" -> "runs/<run_id>.json.gz"). Use a
# trailing "/" for a folder-style layout.
key_prefix: runs/
# Required. Bucket region — the request endpoint and the SigV4 region.
region: eu-west-2
# Optional endpoint override for S3-compatible stores (MinIO, VPC
# endpoints). Defaults to https://{bucket}.s3.{region}.amazonaws.com.
# endpoint: http://localhost:9000
# Compression applied before upload: "gzip" (default) or "none".
compression: gzip
# Credentials are read from the standard AWS_* environment variables
# (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN). Keep
# them out of the plan file; supply them through the environment or
# `aws-vault exec ...`.
thresholds:
http_req_failed: [ "rate<0.02" ]
http_req_duration: [ "p(95)<600" ]
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 s3-archive.