Add request correlation IDs and Kubernetes deployment manifests.#179
Merged
Conversation
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.
Summary
correlationIdMiddlewarethat acceptsX-Request-IDorX-Correlation-ID, generates a UUID when absent, echoesX-Request-IDon every response, and propagates the ID through Winston logs, on-chain transaction submission, Stellar event processing, DLQ payloads, and agent scheduled jobs.deploy/k8s/(Deployment, Service, Ingress, ConfigMap, Secret template, migration Job, HPA) plusdocs/DEPLOYMENT.mdrunbook covering rollout, rollback, secrets, and single-replica scaling constraints for the event listener and agent cron.Closes #168
Closes #167
#168 — Correlation ID details
correlationIdMiddlewarevalidates incoming IDs (alphanumeric/hyphen/underscore, max 128 chars), attaches toreq.correlationIdandres.locals, returnsX-Request-IDheadercorrelationIdviaAsyncLocalStorage; request and error logs include ittransaction-controllerlogs before/after deposit/withdraw submission withcorrelationIdhandleEvent; failed events retain ID in DLQpayload._metadataagent_logs.inputData"requestId"in JSON bodyreadme.mddocuments header convention for client integrators#167 — Kubernetes details
deployment.yamlnode dist/index.js), initContainer migration, liveness/health/live, readiness/health/readyservice.yamlingress.yamlconfigmap.yamlsecret.yaml.exampleDATABASE_URL,JWT_SEED,WALLET_ENCRYPTION_KEY,STELLAR_AGENT_SECRET_KEY,ANTHROPIC_API_KEY,ADMIN_API_TOKEN,TWILIO_AUTH_TOKENmigration-job.yamlprisma migrate deployJobhpa.yamldocs/DEPLOYMENT.mdcovers prerequisites, staging vs production env matrix, rollout/rollback procedures, and the architectural constraint that multiple replicas are unsafe until API/worker split.Test plan
npm run lint:typespassestests/unit/middleware/correlationId.test.ts— preserves client ID, generates when missing, validates formattests/integration/correlationId.integration.test.ts— single request ID across HTTP header, handler, and logstests/unit/stellar/dlq-correlation.test.ts— DLQ retainscorrelationIdin payload metadatakubeconformCI workflow validates manifests on merge/health/readyreturns 200 after initContainer migrationX-Request-IDon deposit request, confirm header echoed and ID appears in logs