Skip to content

Event Framework - Update Event Client SDK, Sidecar & existing logging for Async Audit capabilities #846

Description

@mdebarros

Goal:

As a Hub Operator I want to integrate Event Framework into Mojaloop components so that so that all events (errors, general, etc) can be audited and traced appropriately

Tasks:

  • Event Framework
    • Event SDK for Clients [ ? ]
      • Update to enable "aysnc"-logging for when the audit events are published to the event stream.
    • Event SDK for Server [ ? ]
      • Update to enable "aysnc"-logging for when the audit events are published to the event stream.
    • Event Sidecar for Server [ ? ]
      • Update to enable "aysnc"-logging for when the audit events are published to the event stream.
  • Existing Logging

Acceptance Criteria:

  • Designs are up-to-date
  • Unit Tests pass
  • Integration Tests pass
  • Code Style & Coverage meets standards
  • Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment configs.
  • Event SDK for clients:
    • Normal logs via Winston are done so via an "aysnc"-fashion to reduce IO

Pull Requests:

Follow-up:

  • Update the following environment variables in helm:

    • EVENT_SDK_ASYNC_OVERRIDE_EVENTS -> A comma-separated list of events that should return immediately instead of waiting for the promises to resolve in the recorder.record() function. Any combination of: 'log,audit,trace'
    • CSL_LOG_TRANSPORT: 'file'
    • CSL_TRANSPORT_FILE_OPTIONS (optional dict, refer to central-services-logger readme)
  • Create follow up stories for:

    • Ensuring a fully synchronous flow from publishing an event with the EventSDK client, and said event being received by the EventSDK Server (running in the sidecar) and published on the kafka stream
      • Currently, this uses Event.emit(), which is executed asynchronously.
      • As per discussion with @mdebarros, we essentially want a "stop the world" ability, to make sure that certain events (e.g. audit events) have guarantees that they are published to kafka.

Dependencies:

  • N/A

Accountability:

  • Owner: TBC
  • QA/Review: TBC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions