Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions x-pack/libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,14 @@ func NewBeatForReceiver(settings instance.Settings, receiverConfig map[string]an
}

// Set the default shutdown timeout to 5s. The beat default is 1s, which can be too short for the otel pipeline.
// Packetbeat is excluded because its shutdown_timeout has different semantics.
// See https://github.com/elastic/beats/issues/52031
if b.Info.Beat != "packetbeat" {
switch beatSection := receiverConfig[b.Info.Beat].(type) {
case map[string]any:
if _, alreadySet := beatSection["shutdown_timeout"]; !alreadySet {
beatSection["shutdown_timeout"] = receiverPublisherCloseTimeout.String()
}
case nil:
receiverConfig[b.Info.Beat] = map[string]any{
"shutdown_timeout": receiverPublisherCloseTimeout.String(),
}
switch beatSection := receiverConfig[b.Info.Beat].(type) {
case map[string]any:
if _, alreadySet := beatSection["shutdown_timeout"]; !alreadySet {
beatSection["shutdown_timeout"] = receiverPublisherCloseTimeout.String()
}
case nil:
receiverConfig[b.Info.Beat] = map[string]any{
"shutdown_timeout": receiverPublisherCloseTimeout.String(),
}
}

Expand Down
Loading