Add CloudWatch log aggregation and correlation IDs#109
Open
Obiajulu-gif wants to merge 1 commit intoMissBlue00:mainfrom
Open
Add CloudWatch log aggregation and correlation IDs#109Obiajulu-gif wants to merge 1 commit intoMissBlue00:mainfrom
Obiajulu-gif wants to merge 1 commit intoMissBlue00:mainfrom
Conversation
|
@Obiajulu-gif is attempting to deploy a commit to the missblue00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Obiajulu-gif Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
@binayyub4211 the ci/cd checks failed and there are merge conflicts, please resolve |
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.
This pull request introduces a comprehensive observability and structured logging system for the
stellar-payAPI service. It adds structured JSON logging with correlation IDs, integrates request and exception logging throughout the application, and provides supporting middleware and utilities for request context propagation. Additionally, it includes environment variable configuration and documentation for observability, as well as a CloudWatch dashboard deployment script.Observability and Structured Logging
StructuredLogger) that emits logs with correlation IDs, environment, and contextual metadata, and supports hierarchical child loggers for per-controller/service logging. Added comprehensive unit tests for the logger. (apps/api/src/observability/logger.ts,apps/api/src/observability/logger.spec.ts) [1] [2]AsyncLocalStorageto track correlation IDs and request metadata throughout the lifecycle of each request. Added a middleware (RequestContextMiddleware) to assign/generate correlation IDs and propagate context, and exposed context utilities. (apps/api/src/observability/request-context.ts,apps/api/src/observability/request-context.middleware.ts) [1] [2]Request and Exception Logging
RequestLoggingInterceptor) to log all HTTP requests and responses, including status, duration, user, and correlation IDs. Integrated a global exception filter (LoggingExceptionFilter) to log unhandled exceptions with full context and return correlation IDs in error responses. (apps/api/src/observability/request-logging.interceptor.ts,apps/api/src/observability/logging-exception.filter.ts,apps/api/src/main.ts) [1] [2] [3]apps/api/src/app.controller.ts,apps/api/src/app.service.ts,apps/api/src/health/health.controller.ts,apps/api/src/treasury/treasury.controller.ts,apps/api/src/treasury/treasury.service.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Configuration and Documentation
.env.example, and documented observability features and deployment instructions in the project README. Provided a script and documentation for provisioning CloudWatch dashboards, metric filters, and alarms. (apps/api/.env.example,stellar-pay/README.md) [1] [2]Supporting Codebase Changes
apps/api/src/app.module.ts,apps/api/src/observability/index.ts) [1] [2] [3] [4]Closes #97