feat(log): Implement structured logging#4
Open
ibreakthecloud wants to merge 2 commits into
Open
Conversation
21d94d1 to
049ba9d
Compare
Pull Request Test Coverage Report for Build 14571679809Details
💛 - Coveralls |
Add structured JSON logging with request IDs, timestamps, and context across: - Logger service (standardized format, request tracking) - Request middleware (HTTP metadata, duration) - Webhook processing (timing metrics, status tracking) - Service layer (CLA, Repo, Webhook services) - Controller layer (error handling, context) Improves observability, debugging, and monitoring in Datadog while maintaining existing functionality.
049ba9d to
55343b9
Compare
celiala
reviewed
Apr 17, 2025
celiala
left a comment
There was a problem hiding this comment.
overall LGTM -- some questions (inline)
| function rateLimitLogger(octokit) { | ||
| octokit.hook.after('request', async (response, options) => { | ||
| logger.info(`${options.method} ${options.url}: ${response.status} || Rate Limit: ${response.headers['x-ratelimit-remaining']}/${response.headers['x-ratelimit-limit']} reset at ${new Date(Number(response.headers['x-ratelimit-reset']) * 1000).toTimeString()}`) | ||
| logger.info({ |
| }) | ||
| } catch (error) { | ||
| logger.warn(new Error(error).stack) | ||
| logger.error({ |
There was a problem hiding this comment.
event is WARNING, but logger level is logger.error -- should these match (i.e. both warning or both error)? or keep as-is?
Member
Author
There was a problem hiding this comment.
good catch!
changing logger.error to logger.warn to match previous logging level.
| error: error, | ||
| msg: 'Warning in CLA operation' | ||
| }) | ||
| logger.warn({ |
Member
Author
There was a problem hiding this comment.
this seems like a mistake, fixing this.
| error: error, | ||
| msg: 'Warning in CLA operation' | ||
| }) | ||
| logger.warn({ |
Member
Author
There was a problem hiding this comment.
5f37515 to
34d84d1
Compare
34d84d1 to
0784c91
Compare
rail
approved these changes
Apr 22, 2025
Member
|
LGTM. What do you think about upstreaming this feature? If we decide yes, we should follow the guidelines: https://docs.google.com/document/d/1gnHXsXvLnynCDrDIvhJgQmPAvkdkC_A8/edit?tab=t.0 |
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.
Add structured JSON logging with request IDs, timestamps, and context across:
//todo: Add screenshots
Improves observability, debugging, and monitoring in Datadog while maintaining existing functionality.
Part of CODESYS-80
Note: Some codes are generated by Cursor.