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(events): add metadata info to events #4875

Conversation

lsampras
Copy link
Member

@lsampras lsampras commented Jun 4, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

  • Allow setting kafka headers in message

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@lsampras lsampras added A-framework Area: Framework C-feature Category: Feature request or enhancement A-Analytics labels Jun 4, 2024
@lsampras lsampras self-assigned this Jun 4, 2024
@lsampras lsampras requested review from a team as code owners June 4, 2024 14:21
@lsampras lsampras linked an issue Jun 4, 2024 that may be closed by this pull request
2 tasks
_timestamp: PrimitiveDateTime,
) -> error_stack::Result<(), EventsError>
where
T: Message<Class = Self::MessageClass> + ErasedMaskSerialize,
{
logger::info!(event =? data.masked_serialize().unwrap_or_else(|e| serde_json::json!({"error": e.to_string()})), event_type =? data.get_message_class(), event_id =? data.identifier(), log_type =? "event");
logger::info!(event =? data.masked_serialize().unwrap_or_else(|e| serde_json::json!({"error": e.to_string()})), event_type =? data.get_message_class(), event_id =? data.identifier(), log_type =? "event", metadata = ?metadata);
Copy link
Member

Choose a reason for hiding this comment

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

This can be simplified. Optional change.

Suggested change
logger::info!(event =? data.masked_serialize().unwrap_or_else(|e| serde_json::json!({"error": e.to_string()})), event_type =? data.get_message_class(), event_id =? data.identifier(), log_type =? "event", metadata = ?metadata);
logger::info!(event =? data.masked_serialize().unwrap_or_else(|e| serde_json::json!({"error": e.to_string()})), event_type =? data.get_message_class(), event_id =? data.identifier(), log_type =? "event", ?metadata);

@ivor11 ivor11 self-requested a review June 6, 2024 11:36
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jun 6, 2024
Merged via the queue into main with commit c9dbb56 Jun 6, 2024
16 checks passed
@Gnanasundari24 Gnanasundari24 deleted the 4472-feature-add-support-for-sending-additional-metadata-in-the-messaginginterface branch June 6, 2024 12:18
pixincreate added a commit that referenced this pull request Jun 7, 2024
…out-fix

* 'main' of github.com:juspay/hyperswitch:
  refactor(connector): convert init payment flow to preprocessing flow for shift4 (#4884)
  ci(cypress): Add billing address for bank redirects (#4903)
  refactor(openapi): move openapi to a separate folder (#4859)
  chore(version): 2024.06.07.0
  refactor(outgoing_webhooks): raise errors in the analytics pipeline in case of API client errors or non-2xx responses (#4894)
  chore(config): [MIFINITY] add configs for Mifinity in WASM (#4895)
  feat(router): add `acquirer_country_code` in acquirer_details and send it in netcetera authentication flow (#4835)
  refactor(connector): convert init payment flow to preprocessing flow for nuvei (#4878)
  feat(connector): [MIFINITY] Implement payment flows and Mifinity payment method (#4592)
  fix(connectors): [BOA/CYBS] make avs code optional (#4898)
  feat(events): add metadata info to events (#4875)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Analytics A-framework Area: Framework C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for sending additional metadata in the MessagingInterface
5 participants