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

logs: multilineCollectorTimeout=1s (instead of 100ms) #148

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 6 additions & 5 deletions containers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ import (
)

var (
gcInterval = 10 * time.Minute
pingTimeout = 300 * time.Millisecond
gcInterval = 10 * time.Minute
pingTimeout = 300 * time.Millisecond
multilineCollectorTimeout = time.Second
)

type ContainerID string
Expand Down Expand Up @@ -914,7 +915,7 @@ func (c *Container) runLogParser(logPath string) {
return
}
ch := make(chan logparser.LogEntry)
parser := logparser.NewParser(ch, nil, logs.OtelLogEmitter(containerId))
parser := logparser.NewParser(ch, nil, logs.OtelLogEmitter(containerId), multilineCollectorTimeout)
reader, err := logs.NewTailReader(proc.HostPath(logPath), ch)
if err != nil {
klog.Warningln(err)
Expand All @@ -933,7 +934,7 @@ func (c *Container) runLogParser(logPath string) {
klog.Warningln(err)
return
}
parser := logparser.NewParser(ch, nil, logs.OtelLogEmitter(containerId))
parser := logparser.NewParser(ch, nil, logs.OtelLogEmitter(containerId), multilineCollectorTimeout)
stop := func() {
JournaldUnsubscribe(c.cgroup)
}
Expand All @@ -949,7 +950,7 @@ func (c *Container) runLogParser(logPath string) {
delete(c.logParsers, "stdout/stderr")
}
ch := make(chan logparser.LogEntry)
parser := logparser.NewParser(ch, c.metadata.logDecoder, logs.OtelLogEmitter(containerId))
parser := logparser.NewParser(ch, c.metadata.logDecoder, logs.OtelLogEmitter(containerId), multilineCollectorTimeout)
reader, err := logs.NewTailReader(proc.HostPath(c.metadata.logPath), ch)
if err != nil {
klog.Warningln(err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/containerd/cgroups v1.0.4
github.com/containerd/containerd v1.6.26
github.com/coreos/go-systemd/v22 v22.5.0
github.com/coroot/logparser v1.1.5
github.com/coroot/logparser v1.1.6
github.com/docker/docker v25.0.3+incompatible
github.com/florianl/go-conntrack v0.3.0
github.com/go-kit/log v0.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coroot/dotnetdiag v1.2.2 h1:PVP/By8o+xhPjfVolJYcjHLbFQInM7pkaD6/otPLc8Q=
github.com/coroot/dotnetdiag v1.2.2/go.mod h1:veXCMlFzm1yNl7wwJb/ZLxO4WbzhDBoy1VG1XtkH2ls=
github.com/coroot/logparser v1.1.5 h1:gCXeJ0qeRsQWnkK9dOwEiZT3DMjCWp1MTY3ZsPoC3Bk=
github.com/coroot/logparser v1.1.5/go.mod h1:YfYxn9FYBm5GYHHUB4zI22irFAWVDe2bcbOWDHKSmEo=
github.com/coroot/logparser v1.1.6 h1:iMZ7CfKfbSKDD+LayGnd14s9M6/T25/+GKosKYIMoCk=
github.com/coroot/logparser v1.1.6/go.mod h1:YfYxn9FYBm5GYHHUB4zI22irFAWVDe2bcbOWDHKSmEo=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down