Repository navigation
feat: runtime package (ENG-435) - #1
Merged
malpou merged 1 commit intoOct 13, 2026
Merged
Conversation
One Go package for the runtime contract: configuration by the chart's names, probes on 8081, metrics on 9464, OTel tracing named from OTEL_SERVICE_NAME and JSON logging with trace ids. Includes an example service, the platform lint config with wrapcheck, CI and release-please.
malpou
deleted the
malthe/eng-435-platform-kit-repo-with-the-runtime-package
branch
October 13, 2026 17:54
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.
Implements the runtime contract once, for every service whose code we control (ENG-435).
What is here
runtime.Newloads the contract's configuration names (ENVIRONMENT,LOG_LEVEL,OTEL_SERVICE_NAME,SERVICE_IDENTITY,DATABASE_URL,NATS_URL,NATS_TOKEN_FILE,REDIS_URL), builds the JSON logger and sets up tracing and metrics.rt.Ready(name, check)registers a readiness check.rt.Serve(ctx, handler)serves the handler on 8080,/healthzand/readyzon 8081 and/metricson 9464, then drains and flushes when the context is done. A nil handler serves no traffic port, for workers.OTEL_SERVICE_NAME; nothing names the deployment in code.example/is a minimal service.vX.Y.Ztags.Behaviour worth knowing
/healthznever runs the readiness checks./readyzanswers 503 while a check fails and once the process has begun to stop.client_golangcounters are both scraped.Tests
The tests run a small service as a child process on the real ports and assert through HTTP, stderr and an in-process OTLP receiver: the three ports and endpoints, readiness following a failing check while liveness stays up, every config name, the trace service name from config, trace ids and level in the logs, the worker mode and not-ready while draining.