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

Consider adding the possibility to save and access metadata #26

Closed
ricksecretin opened this issue Jul 19, 2021 · 5 comments · Fixed by #52
Closed

Consider adding the possibility to save and access metadata #26

ricksecretin opened this issue Jul 19, 2021 · 5 comments · Fixed by #52
Assignees
Labels
enhancement New feature or request vNext Next release
Projects

Comments

@ricksecretin
Copy link

ricksecretin commented Jul 19, 2021

It would be nice to be able to save and access metadata easily in eventuous.

  1. Currently a 'null' is saved for metadata when appending events to the eventstore.
    It would be nice if there was a method that you could override like 'AddMetadata' when inheriting from AggregateStore to set the metadata.

  2. Currently no access to metadata in event handlers

This would be nice to use the build-in $correlationId of eventStore.
Currently I had to reimplement some of the already implemented classes like aggregateStore to make this possible.

Thanks.

@alexeyzimarev
Copy link
Contributor

Yes, I am working on that already. The upcoming release has a requirement to allow storing and retrieving metadata also because of the distributed tracing feature, which is coming.

@alexeyzimarev
Copy link
Contributor

Btw @ricksecretin if you have any thoughts about #9 please write there.

@alexeyzimarev alexeyzimarev self-assigned this Aug 4, 2021
@alexeyzimarev alexeyzimarev added enhancement New feature or request vNext Next release labels Aug 4, 2021
@alexeyzimarev alexeyzimarev added this to Triage in Eventuous via automation Aug 4, 2021
@alexeyzimarev alexeyzimarev moved this from Triage to In progress in Eventuous Aug 4, 2021
@alexeyzimarev
Copy link
Contributor

@ricksecretin any thoughts about what to do with the loaded metadata when reading events? The aggregate store can't really do anything with it.

alexeyzimarev added a commit that referenced this issue Sep 29, 2021
- Serializer (as it might be different from event serializer)
- Full coverage for EventStore
- Add meta in the aggregate store (allows using $correlationId)
- Unclear what to do when reading meta as AS has nothing to do with it
- IEventStore needs meta as well as it can do some meta injection for tracing
@ricksecretin
Copy link
Author

ricksecretin commented Oct 5, 2021

@alexeyzimarev for me personally I don't think it's useful to have access to it when calling the aggregateStore.
I don't directly see a use case where you would need the metadata.

@alexeyzimarev
Copy link
Contributor

Right, that's my thought as well. So far, both ReceivedEvent and ProducedMessage got metadata.

This commit f0afa0a adds traces to the meta for producers. As it uses the AcitivySource API, it works out of the box with OpenTelemetry, although I plan to add some extensions to make it easier. Also, the parent-child relationships will work when upstream and downstream parts are instrumented. You'd need to avoid using tags that start with eventuous as those are reserved. And I forgot to add $correlationId default EventStore meta but I will add it later.

Eventuous automation moved this from In progress to Done Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vNext Next release
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants