Skip to content

Commit

Permalink
[Heartbeat]: fix error formatting on socktrace timeout (#35434)
Browse files Browse the repository at this point in the history
* [Heartbeat]: fix error formatting on socktrace timeout

* add changelog entry

* fix other formating as well
  • Loading branch information
vigneshshanmugam authored and chrisberkhout committed Jun 1, 2023
1 parent c6b5bea commit 7372123
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415
- Fix issue using projects in airgapped environments by disabling npm audit. {pull}34936[34936]
- Fix broken state ID location naming. {pull}35336[35336]
- Fix output pipeline exit on run_once. {pull}35376[35376]
- Fix formatting issue with socket trace timeout. {pull}35434[35434]

*Heartbeat*

Expand Down
4 changes: 2 additions & 2 deletions heartbeat/beater/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ func New(b *beat.Beat, rawConfig *conf.C) (beat.Beater, error) {
if stConfig != nil {
// Note this, intentionally, blocks until connected to the trace endpoint
var err error
logp.L().Info("Setting up sock tracer at %s (wait: %s)", stConfig.Path, stConfig.Wait)
logp.L().Infof("Setting up sock tracer at %s (wait: %s)", stConfig.Path, stConfig.Wait)
trace, err = tracer.NewSockTracer(stConfig.Path, stConfig.Wait)
if err != nil {
logp.L().Fatal("could not connect to socket trace at path %s after %s timeout: %s", stConfig.Path, stConfig.Wait, err)
logp.L().Fatalf("could not connect to socket trace at path %s after %s timeout: %w", stConfig.Path, stConfig.Wait, err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions heartbeat/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func NewSockTracer(path string, wait time.Duration) (st SockTracer, err error) {
return st, fmt.Errorf("wait time for sock trace exceeded: %s", wait)
}
if _, err := os.Stat(st.path); err == nil {
logp.L().Info("socktracer found file for unix socket: %s, will attempt to connect")
logp.L().Infof("socktracer found file for unix socket: %s, will attempt to connect")
break
} else {
logp.L().Info("socktracer could not find file for unix socket at: %s, will retry in %s", delay)
logp.L().Infof("socktracer could not find file for unix socket at: %s, will retry in %s", delay)
time.Sleep(delay)
}
}
Expand Down

0 comments on commit 7372123

Please sign in to comment.