Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: HTTP Request ID Middleware #63

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Conversation

jay-dee7
Copy link
Member

Adds http request id in logs and response headers

Signed-off-by: jay-dee7 jasdeepsingh.uppal@gmail.com

@jay-dee7 jay-dee7 requested a review from guacamole November 19, 2021 06:48
@jay-dee7 jay-dee7 self-assigned this Nov 19, 2021
telemetry/log.go Outdated
@@ -36,7 +36,7 @@ func ZerologMiddleware(baseLogger zerolog.Logger, fluentbitClient fluentbit.Flue
},
}

logFmt := `{"time":"${time_rfc3339}","request_id":"${request_id}","remote_ip":"${remote_ip}",` +
logFmt := `{"time":"${time_rfc3339}","x-request-id":"${request_id}","remote_ip":"${remote_ip}",` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jay-dee7 , could you make it '_' instead of '-' since everything else is underscored

@jay-dee7 jay-dee7 force-pushed the http-request-id-middleware branch from 0ff5b69 to c52b23d Compare November 19, 2021 06:52
Adds http request id in logs and response headers

Signed-off-by: jay-dee7 <jasdeepsingh.uppal@gmail.com>
@jay-dee7 jay-dee7 force-pushed the http-request-id-middleware branch from c52b23d to f3fdd67 Compare November 19, 2021 06:53
Copy link
Member

@guacamole guacamole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🥇

@guacamole guacamole merged commit ba61e41 into master Nov 19, 2021
@guacamole guacamole deleted the http-request-id-middleware branch November 19, 2021 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants