rust-cloud-native
Skill1 starsChanged 40 days agoMITView on GitHub
Cloud-native Rust services — gRPC with tonic, observability (tracing + OpenTelemetry), health/readiness probes, 12-factor config, graceful shutdown, and lean containers. Use when building microservices or gRPC APIs, running in Docker/Kubernetes, or adding tracing/metrics/health checks. Triggers: gRPC, tonic, opentelemetry, OTLP, readiness, 12-factor, distroless.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- adxptived/Rust-Skillstheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- adxptived/Rust-Skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- addressing-findingsSkill
- auditSkill
- codebase-onboardingSkill
- codex-reviewSkill
- compatibilitySkill
- debuggingSkill
- developSkill
- distributed-racesSkill
- memorySkill
- nix-dev-envSkill
- nix-flakesSkill
- nixosSkill
- nix-packagingSkill
- nix-reviewSkill
- refactoringSkill
- retroSkill
- review-initSkill
- review-rulesSkill
- rust-architecture-reviewSkill
- rust-architectureSkill
- rust-cliSkill
- rust-concurrencySkill
- rust-ecosystemSkill
- rust-embeddedSkill
- rust-errorsSkill
- rust-fintechSkill
- rust-idiomsSkill
- rust-macrosSkill
- rust-mlSkill
- rust-navigationSkill
- rust-ownershipSkill
- rust-performanceSkill
- rust-pluginsSkill
- rust-reviewSkill
- rust-securitySkill
- rust-testingSkill
- rust-traitsSkill
- rust-unsafeSkill
- rust-webSkill
- specsSkill
- sql-reviewSkill
The file
Files
Rust Cloud-Native
Services that run in containers under an orchestrator: they must be observable, resilient, and operable — not just correct. Rust's small static binaries and low footprint are a great fit. gRPC and observability deep-dives are in the sub-files; ops concerns are here.
When to Use
- Building a microservice or gRPC API
- Running a service in Docker / Kubernetes
- Adding tracing, metrics, health checks, graceful shutdown
The concerns
| Concern | Approach | Where |
| Service-to-service RPC | gRPC via tonic (proto + codegen) | grpc.md |
| Logs / traces / metrics | tracing + OpenTelemetry (OTLP) | observability.md |
| Is it alive / ready? | liveness + readiness endpoints | below |
| Config | 12-factor: env-driven, fail-fast | below |
| Clean rollout | graceful shutdown on SIGTERM | below |
| Deploy artifact | multi-stage, minimal container | below |
The HTTP side (REST, axum) is rust-web; this skill is the service/infra layer that wraps it.
Health: liveness ≠ readiness
Kubernetes probes two different things — don't conflate them:
- Liveness — "is the process wedged?" Fails → pod restarted. Keep it cheap and dependency-free (a deadlocked process should fail; a slow database should not trigger a restart loop).
- Readiness — "can it serve traffic right now?" Fails → removed from the load balancer. This one does check dependencies (DB reachable, caches warm). On shutdown, fail readiness first so traffic drains before you stop.
Expose both as tiny endpoints (gRPC health service, or /livez and /readyz in axum).
Config: 12-factor, fail fast
Configure from the environment (env vars / mounted secrets), not baked-in files — the same
image runs in every environment. Load once at startup into a typed struct, validate, and exit
on error — a misconfigured service should crash at boot, not fail per request (→ rust-errors:
startup precondition is a defect). Layer env over file over defaults with figment
(→ rust-cli config). Read secrets into a secrecy::SecretBox (→ rust-security).
Graceful shutdown
Orchestrators send SIGTERM then wait, then SIGKILL. Catch SIGTERM, fail readiness, stop accepting new requests, drain in-flight ones, close pools, exit:
async fn shutdown_signal() {
let term = async {
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
.unwrap().recv().await;
};
tokio::select! {
_ = tokio::signal::ctrl_c() => {},
_ = term => {},
}
}
// axum::serve(..).with_graceful_shutdown(shutdown_signal()) (rust-web)
// tonic Server::builder()...serve_with_shutdown(addr, shutdown_signal())Container: small, static, non-root
- Multi-stage build: compile in a full Rust image, copy only the binary into a tiny runtime.
- Minimal base:
gcr.io/distroless/cc(or a staticmuslbuild intoscratch) — no shell, smaller attack surface. - Non-root user; read-only filesystem where possible.
- Build deps with
cargo chefto cache the dependency layer and speed CI. - Scan the image / deps (
cargo deny,cargo audit) →rust-security.
FROM rust:1 AS build
WORKDIR /app
COPY . .
RUN cargo build --release
FROM gcr.io/distroless/cc:nonroot
COPY --from=build /app/target/release/svc /svc
USER nonroot:nonroot # distroless non-root user (uid 65532)
ENTRYPOINT ["/svc"]Boundaries
- REST/HTTP handlers →
rust-web; async runtime/tasks →rust-concurrency. - Mapping domain errors to gRPC
Status→rust-errors+ grpc.md. - Dependency/supply-chain/secret scanning and in-memory secret handling →
rust-security. - Config layering mechanics (
figment) →rust-cli.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

