Add Spring Boot-style actuator endpoints (/manage/*) - #23
Open
Grizaster wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Spring Boot-style “actuator” management endpoints under /manage/* to the serve (Axum HTTP server) mode, while keeping the legacy /health endpoint for backward compatibility.
Changes:
- Adds
/manage/health,/manage/info,/manage/env, and/manage/metricsendpoints and introduces shared in-memory metrics state. - Tracks basic render/request metrics using atomic counters and reports uptime.
- Extends dependencies to support JSON responses (
serde_json) and Unix disk stats viastatvfs(libc).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/main.rs | Adds management endpoints, shared AppState, disk-space health reporting, and render/request metrics collection. |
| Cargo.toml | Adds serde_json for JSON responses and libc (Unix) for statvfs; updates serve feature deps. |
| Cargo.lock | Locks new transitive dependencies from serde_json and libc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds /manage/* endpoints for operational monitoring: - GET /manage/health: health check with real disk space (statvfs) - GET /manage/info: build info (version, arch, OS, timezone, language) - GET /manage/env: filtered env vars (secrets like TOKEN/KEY/PASSWORD excluded) - GET /manage/metrics: render counts, avg render time, uptime Metrics tracked via AtomicU64 counters. Existing /health kept for backwards compatibility. Dependencies: serde_json (optional, behind serve feature), libc (Unix only, for statvfs).
GOODBOY008
force-pushed
the
actuator-endpoints
branch
from
July 20, 2026 05:49
4e423d8 to
1b053b2
Compare
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.
Overview
Adds Spring Boot-style management endpoints under
/manage/for operational monitoring of the HTTP server. The existing/healthendpoint is kept for backwards compatibility.Endpoints
GET /manage/healthstatvfs(Unix)GET /manage/infoGET /manage/envTOKEN,KEY,PASSWORD,SECRET,CREDENTIAL) are excludedGET /manage/metricsImplementation Details
AtomicU64counters andInstanttimerfailed_rendersincremented on all error paths (render, PNG encode, image decode, PDF encode)/manage/healthreports real disk space values viastatvfs(Unix) with 10MB threshold/manage/envfilters sensitive variables by name pattern/manage/metricsreportsavg_mscorrectly (no erroneous unit conversion)Dependencies
serde_json(optional, behindservefeature) for structured JSON responseslibc(Unix only, target-specific) forstatvfsin/manage/healthFiles Changed
src/main.rs— actuator endpoints, metrics tracking, shared app stateCargo.toml—serde_jsondependency +libcfor Unix targetsCargo.lock— updated