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

Observability and IncompleteEvents #555

Open
pcuriel opened this issue Apr 15, 2024 · 2 comments
Open

Observability and IncompleteEvents #555

pcuriel opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
in: event publication registry Event publication registry in: observability Observability support meta: waiting for feedback Waiting for feedback of the original reporter

Comments

@pcuriel
Copy link

pcuriel commented Apr 15, 2024

When events are resubmitted, their original tracing context is lost.

Keeping this information is specially relevant when events are externalized.

Any thoughts on persisting context on the DB and restoring it when the event is read? Maybe using nullable column(s) and extracting context via an optional Bean, configured by spring-modulith-observability when this module is added.

@odrotbohm
Copy link
Member

Does it really make sense to fully reestablish that context? Wouldn't those traces then look like an actual request having been performed?

@odrotbohm odrotbohm self-assigned this Apr 18, 2024
@odrotbohm odrotbohm added in: event publication registry Event publication registry in: observability Observability support meta: waiting for feedback Waiting for feedback of the original reporter labels Apr 18, 2024
@pcuriel
Copy link
Author

pcuriel commented Apr 22, 2024

I think it makes sense regarding event traceability. I will try to explain why with an example.

Given this scenario:

  • Service A receives a request with Trace ID ABC
  • As a part of that request, it publishes MyEvent via RabbitMQ.
  • Service B receives MyEvent and does whatever.
  • Service Creceives MyEvent and does whatever.

Considering happy-path execution, Trace ID ABC would enable you to trace up from the initial request to Service A, down to MyEvent reception and processing in Service B and Service C.

However, if anything goes wrong publishing MyEvent (e.g., RabbitMQ is down for a few seconds) and it is finally published when retried from the EventRepository, it will be published with another Trace ID, and we won't be able to trace it down to Service B and Service C.

However, persisting the context and restoring it when retrying the event would solve this issue.
(Note: to simplify the example I'm referring only to the Trace ID, but the same would apply to other Trace Context info).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry in: observability Observability support meta: waiting for feedback Waiting for feedback of the original reporter
Projects
None yet
Development

No branches or pull requests

2 participants