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

MG-1965 - Process Event Logs #2057

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

rodneyosodo
Copy link
Member

@rodneyosodo rodneyosodo commented Jan 12, 2024

What type of PR is this?

This is a feature PR because it adds eventlogs service to store history of events

What does this do?

Adds event logs service

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have included tests for my changes.

Did you document any new/modified feature?

Yes, I have updated the documentation for the new feature.

Notes

api/openapi/event-logs.yml Outdated Show resolved Hide resolved
eventlogs/postgres/events.go Outdated Show resolved Hide resolved
@rodneyosodo rodneyosodo force-pushed the events-svc branch 3 times, most recently from b877d43 to 26ef76a Compare February 12, 2024 20:46
@rodneyosodo rodneyosodo force-pushed the events-svc branch 6 times, most recently from ec76941 to 35c5eb1 Compare February 26, 2024 16:54
@rodneyosodo rodneyosodo marked this pull request as ready for review February 26, 2024 16:58
@rodneyosodo rodneyosodo force-pushed the events-svc branch 2 times, most recently from 449f7ac to a817162 Compare March 8, 2024 07:59
@rodneyosodo rodneyosodo force-pushed the events-svc branch 6 times, most recently from 74d1aa5 to c993b35 Compare March 18, 2024 09:02
@rodneyosodo rodneyosodo force-pushed the events-svc branch 3 times, most recently from 7c42d98 to 3ac623d Compare March 22, 2024 15:36
@rodneyosodo rodneyosodo force-pushed the events-svc branch 5 times, most recently from 3283210 to 1cab6c0 Compare April 4, 2024 09:04
@rodneyosodo rodneyosodo force-pushed the events-svc branch 6 times, most recently from c65d282 to 3eb772c Compare June 12, 2024 14:20
case ThingEntity:
return "((operation LIKE 'thing.%' AND attributes->>'id' = :entity_id) OR (attributes->>'thing_id' = :entity_id))"
case ChannelEntity:
return "((operation LIKE 'channel.%' AND attributes->>'id' = :entity_id) OR (attributes->>'group_id' = :entity_id))"
Copy link
Contributor

Choose a reason for hiding this comment

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

@rodneyosodo
I could not list channelscreate event.
I think this should be group or we should change in all events to channel

activitylog/service.go Outdated Show resolved Hide resolved
cli/activitylog.go Show resolved Hide resolved
rodneyosodo and others added 15 commits June 14, 2024 17:44
Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
- Added attributes and metadata as seperate values of activity. Metadata is normal metadata for an entity while attributes are the other entities from the event for example id, updated_at e.t.c
- add entityType which can either be empty or user, group, thing or channel
- add query method which generates SQL query depending on the entity type for example is the entity is user we retrieve entities that have id as the entity id and have operation that is prefixed with user. OR events that have user_id as an attribute correcsponding to that entity
- update emission and consumption of events. Emit native types for example string slice for tags rather than formating it and also metadata as it is rather than marshalling it first into bytes

This contains breaking changes on how events are consumed

Signed-off-by: Rodney Osodo <[email protected]>
A normal user can be able to list invitations but they will get only the operation and time it occurred unless you are the platform admin where you can view anything

Signed-off-by: Rodney Osodo <[email protected]>
Signed-off-by: Rodney Osodo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚧 In Progress
Development

Successfully merging this pull request may close these issues.

Feature: Process Thing event log
5 participants