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

feat: Configuration for correlation plugin #245

Merged
merged 3 commits into from Dec 27, 2023

Conversation

chsukivra
Copy link
Contributor

  • 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)
@chsukivra
Copy link
Contributor Author

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.

Copy link
Contributor

@burbas burbas left a 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),
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@chsukivra chsukivra marked this pull request as ready for review December 27, 2023 13:12
@Taure Taure merged commit aa4c890 into novaframework:master Dec 27, 2023
@chsukivra chsukivra deleted the feat/correlation_plugin/config branch May 9, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants