Skip to content

Commit

Permalink
Merge pull request #392 from ethpandaops/fix/server-dupes
Browse files Browse the repository at this point in the history
fix(server): Resolve duplicate events being exported
  • Loading branch information
Savid authored Oct 8, 2024
2 parents 39273fe + fbe89d1 commit 4854584
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/sentry/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ outputs:
Value: []byte(`
preset: docker-compose
outputs:
- name: ethpandaops
- name: dockercompose
type: xatu
config:
address: localhost:8080
Expand Down
6 changes: 5 additions & 1 deletion pkg/server/service/event-ingester/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ func (h *Handler) Events(ctx context.Context, events []*xatu.DecoratedEvent, use
}
}

handlerFilteredEvents := make([]*xatu.DecoratedEvent, 0)
// Route the events to the correct handler
for _, event := range events {
if event == nil || event.Event == nil {
continue
Expand Down Expand Up @@ -199,9 +201,11 @@ func (h *Handler) Events(ctx context.Context, events []*xatu.DecoratedEvent, use

event.Meta.Server = e.AppendServerMeta(ctx, &meta)

filteredEvents = append(filteredEvents, event)
handlerFilteredEvents = append(handlerFilteredEvents, event)
}

filteredEvents = handlerFilteredEvents

// Redact the events again
if group != nil {
redactedEvents, err := group.ApplyRedacter(filteredEvents)
Expand Down
7 changes: 1 addition & 6 deletions pkg/server/service/event-ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,12 @@ func (e *Ingester) CreateSinks() ([]output.Sink, error) {
sinks := make([]output.Sink, len(e.config.Outputs))

for i, out := range e.config.Outputs {
if out.ShippingMethod == nil {
shippingMethod := processor.ShippingMethodSync
out.ShippingMethod = &shippingMethod
}

sink, err := output.NewSink(out.Name,
out.SinkType,
out.Config,
e.log,
out.FilterConfig,
*out.ShippingMethod,
processor.ShippingMethodSync,
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 4854584

Please sign in to comment.