Repository navigation
feat: export jussi_build_info on /metrics so the live build is verifiable - #271
Merged
Merged
Conversation
…able
/health and / redact source_commit/docker_tag to the literal "unknown"
unless JUSSI_EXPOSE_VERSION=true. That literal is the same string a build
without CI build args produces, so a redacted deployment and a
metadata-less image are indistinguishable from outside — and nothing
internal reports the running commit either.
Export the metadata on the access-restricted /metrics endpoint instead:
a new jussi_build_info{commit,tag} gauge, set once at startup from the
same SOURCE_COMMIT/DOCKER_TAG values the health handler receives. The
redaction behaviour of / and /health is unchanged, and there is no new
dependency beyond prometheus/testutil in tests.
ety001
added a commit
that referenced
this pull request
Sep 30, 2026
…ss docs (#272) Follow-ups from the audit of #271. - The /metrics allowlist could not be configured from the environment: JUSSI_PROMETHEUS_ALLOWED_IPS was not bound anywhere, so a deployment that disables localhost_only had no way to restrict the endpoint — the variable was silently ignored and (because SetupRouter only mounts the whitelist middleware when the list is non-empty) no access control was applied at all. Bind it to prometheus.allowed_ips and split the value after unmarshal, mirroring JUSSI_SERVER_TRUSTED_PROXIES. - The docs described /metrics as access-restricted. With localhost_only=false and an empty allowlist no middleware is mounted, so state the actual semantics in CONFIGURATION.md, METRICS.md and the agent-facing observability notes, and document the new variable. - Add the tests this was missing: config env parsing, and the app wiring that publishes jussi_build_info (the unit test of SetBuildInfo cannot catch a dropped call in SetupRouter) — including that a non-loopback client is admitted when neither knob is set and rejected once an allowlist exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
/healthand/redactsource_commit/docker_tagto the literal"unknown"unlessJUSSI_EXPOSE_VERSION=true, so a public deployment does not fingerprint itself. That literal is also what a build without CI build args produces, which means a redacted deployment and a metadata-less image look identical from outside — and there is currently no non-public channel that reports which commit is running.What
internal/telemetry/buildinfo.go: newjussi_build_info{commit,tag}gauge (value always1; the information is in the labels).SetBuildInforesets first, so re-setting inside one process never leaves the previous build's labels exportable.internal/app/app.go: publish it once at startup from the sameSOURCE_COMMIT/DOCKER_TAGvalues the health handler already receives.internal/handlers/health_test.go: pins the redaction contract and theJUSSI_EXPOSE_VERSION=trueoverride.docs/METRICS.md(new Build Metrics section, including why the metric and not/health),docs/CONFIGURATION.md,docs/AI-driver/07-errors-and-observability.md.No change to the
/and/healthpayloads, and no new dependency: onlyprometheus/testutil(part ofclient_golang) is used in tests.Verification
go vet ./...andgo test ./... -race -count=1pass.Real process run with the build metadata set:
/metricsexposeswhile
/healthkeeps reporting"unknown"unlessJUSSI_EXPOSE_VERSION=true.Notes
/metricskeeps its existing access control (prometheus.localhost_only, thenprometheus.allowed_ips), so deployments that keep the default redaction do not publish their build metadata anywhere new.