What's new in v0.5.3
Authenticated Prometheus support on the daemon's three outbound scrapers. [green.cloud], [green.scaphandre] and the pg_stat Prometheus scrape path each gain an optional auth_header TOML field, plus --auth-header on perf-sentinel pg-stat and --pg-stat-auth-header on perf-sentinel report. Unlocks Grafana Cloud, Grafana Mimir and any Prometheus sitting behind bearer/basic auth without a local port-forward. Headers are marked sensitive so hyper redacts them from debug output and HPACK tables, each config's manual Debug impl replaces auth_header with [REDACTED] so a stray tracing::debug!(?cfg) never leaks the credential, and a parse failure at startup disables the scraper with a tracing::error! rather than retry-spamming. Three new env vars (PERF_SENTINEL_CLOUD_AUTH_HEADER, PERF_SENTINEL_SCAPHANDRE_AUTH_HEADER, PERF_SENTINEL_PGSTAT_AUTH_HEADER) take precedence over the config or flag value, matching the Electricity Maps PERF_SENTINEL_EMAPS_TOKEN precedence. A startup warn nudges toward the env var when the credential is supplied via the config file or CLI flag.
Added
auth_headeron[green.cloud]and[green.scaphandre]TOML sections. Optional curl-format"Name: Value"string attached to every outbound Prometheus request. Required for Grafana Cloud, Grafana Mimir or any ingress enforcing bearer/basic auth. ManualDebugimpl on both config structs redacts the field so it can never land in a diagnostic log.--auth-headeronperf-sentinel pg-stat. Pairs with--prometheus. Same"Name: Value"format as--auth-headerontempo/jaeger-query.--pg-stat-auth-headeronperf-sentinel report. Pairs with--pg-stat-prometheus. Same format and semantics.- Env-var precedence with startup warn.
PERF_SENTINEL_CLOUD_AUTH_HEADER,PERF_SENTINEL_SCAPHANDRE_AUTH_HEADERandPERF_SENTINEL_PGSTAT_AUTH_HEADERtake precedence over the config or CLI flag value. MirrorsPERF_SENTINEL_EMAPS_TOKEN. - Config-load validation. Malformed
auth_headervalues (empty, wrong format, forbidden framing headers, CR/LF injection attempts, >8 KiB input) fail at.perf-sentinel.tomlload time with a clear error instead of silently disabling the scraper at spawn.
Changed
- BREAKING (
perf-sentinel-core, pre-1.0 so minor-bump allowed).http_client::fetch_getandingest::pg_stat::fetch_from_prometheusgain anauth/auth_headerparameter.score::cloud_energy::config::CloudEnergyConfigandscore::scaphandre::config::ScaphandreConfiggain anauth_header: Option<String>field and replace the derivedDebugimpl with a manual redacting one. External consumers calling these directly must passNone(or addauth_header: Noneto struct literals) for the current behavior.
Fixed
- Cleartext HTTP + auth header emits
tracing::warn!. When a configured scraper endpoint starts withhttp://and anauth_headeris set, a warning fires once at startup so a typo is caught before the credential traverses the network in clear. - Malformed auth headers fail fast. An invalid
auth_headerstring logs atracing::error!and disables the affected scraper subsystem at spawn rather than retry-spamming on every scrape tick.
Tests
- New on-wire tests for
fetch_get,fetch_from_prometheus, the cloud scraper and the scaphandre scraper that spawn aTcpListener, capture the outgoing request bytes and assert theAuthorizationheader lands on the socket. Shared harness extracted intotest_helpers::spawn_capture_server, removing ~110 lines of duplicated listener + mpsc scaffolding and consolidating the pattern in one place. - Shared
assert_debug_redacts_secret!macro unifies the three config-Debug regression tests (cloud_energy, scaphandre, electricity_maps). Catches any accidental#[derive(Debug)]re-introduction on the config structs.
Docs
- New "Authenticated Prometheus endpoint" subsections under the Scaphandre, cloud-native energy and pg_stat sections of
docs/INTEGRATION.mdplus French parity indocs/FR/INTEGRATION-FR.md. Full recipes for config, env var, and cleartext-warn behavior.
Install
Prebuilt binaries (Linux amd64 / arm64, macOS arm64, Windows amd64):
curl -LO https://github.com/robintra/perf-sentinel/releases/download/v0.5.3/perf-sentinel-linux-amd64
chmod +x perf-sentinel-linux-amd64
sudo mv perf-sentinel-linux-amd64 /usr/local/bin/perf-sentinelLinux binaries are statically linked against musl and run on any distribution (Alpine, Debian, RHEL, Ubuntu any version) regardless of glibc version, and inside FROM scratch images.
From crates.io:
cargo install perf-sentinelDocker:
docker run --rm -p 4317:4317 -p 4318:4318 \
ghcr.io/robintra/perf-sentinel:0.5.3 watch --listen-address 0.0.0.0Also available on Docker Hub: robintrassard/perf-sentinel:0.5.3.
Helm (chart 0.2.3 ships 0.5.3 as its appVersion default):
helm install perf-sentinel oci://ghcr.io/robintra/charts/perf-sentinel \
--version 0.2.3 \
--namespace observability --create-namespaceVerify the binary against SHA256SUMS.txt:
curl -LO https://github.com/robintra/perf-sentinel/releases/download/v0.5.3/SHA256SUMS.txt
sha256sum -c SHA256SUMS.txt --ignore-missingFull diff: v0.5.2...v0.5.3