-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Configuration for correlation plugin #245
feat: Configuration for correlation plugin #245
Conversation
chsukivra
commented
Dec 22, 2023
- request_correlation_header, if set take this request's header value and use as correlation id
- logger_metadata_key, override the entry in logger metadata (default: <<"correlation-id">>)
- dictionary_key, additional process dictionary entry storing corr id (default: correlation_id)
- request_correlation_header, if set take this request's header value and use as correlation id - logger_metadata_key, override the entry in logger metadata (default: <<"correlation-id">>) - dictionary_key, additional process dictionary entry storing corr id (default: correlation_id)
This is just a draft of something that would make the built in correlation plugin a bit more useful for us, and maybe for other users of nova. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for the dictionary-thing I commented on!
Req1 = cowboy_req:set_resp_header(<<"X-Correlation-ID">>, UUID, Req), | ||
ok = update_logger_metadata(CorrId, Opts), | ||
%% Redundant entry, allow controllers to erlang:get(correlation_id) | ||
ok = put_process_dictionary(CorrId, Opts), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably a better idea to set a key in the Req object instead for keeping this in the process-dictionary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed so that it is set as the correlation_id
field in the request object.