-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update events logic to allow mapping specific events to specific tags #333
Update events logic to allow mapping specific events to specific tags #333
Conversation
pkg/types/event.go
Outdated
|
||
var EventAbstractionTriggerSchemaVersion = "1.0" | ||
|
||
type EventAbstractionTriggeredSchema struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have an event_type field or something? this feels ambiguous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stubtype includes the abstraction and trigger type
pkg/repository/base.go
Outdated
@@ -147,6 +147,7 @@ type EventRepository interface { | |||
PushContainerStoppedEvent(containerID string, workerID string) | |||
PushWorkerStartedEvent(workerID string) | |||
PushWorkerStoppedEvent(workerID string) | |||
PushAbstractionTriggeredEvent(workspaceId string, stub *types.Stub) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like this name, it feels confusing. I'd almost argue for more specific functions even at the risk of more code / being more verbose. I./e. PushDeployedStubEvent()
PushServedStubEvent()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this better. I renamed the subject from abstraction -> stub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm still a little iffy on the event tag mapping but let's try it out.
HTTP Inputs in Fluent-bit dynamically set
tags
based off the URI of the request.e.g. a request to
fluentbit.monitoring:9880/tag_name
results in fluent-bit automatically setting a tag oftag_name
to the eventThese tag names are then matched with an output in the example below
By default, the events will map to the tag
http.1
unless it's override in the input. However, I added a mapping that can be set inconfig.yaml
to map events to specific tags by event name as such: