openedx / openedx-events

Open edX events from the Hooks Extensions Framework
Apache License 2.0
11 stars 21 forks source link

Distinguish between web and worker in EventsMetadata.source #151

Open rgraber opened 1 year ago

rgraber commented 1 year ago

Right now, the EventsMetadata object is hardcoded to identify the source as "openedx/{service}/web." In order to be compliant with https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0041-arch-async-server-event-messaging.html#id3, we should be distinguishing between web and workers. It's not immediately obvious to me where we can get this information. The only setting I can find that distinguishes web from worker is NEW_RELIC_APP_NAME, which seems very fragile.

robrap commented 1 year ago
  1. Even for sync messages, the "/web" suffix would be inaccurate for any signals sent in a worker. This does not just affect async (event bus) messages.
  2. At least for edx.org configs, there isn't an easy way to have different settings between web and workers, so introducing a setting would not help.
  3. One solution noted in https://github.com/openedx/openedx-events/issues/77#issuecomment-1328294890 is to just drop the "/web" part of the source. We also have a source host. Do we want to update OEP-41 as well?
robrap commented 1 year ago

FYI: @ormsbee @mariajgrimaldi