Skip to content

Commit

Permalink
Fix wrong timestamp in heartbeat events (#4876)
Browse files Browse the repository at this point in the history
(cherry picked from commit 91b8b10)
  • Loading branch information
Steffen Siering authored and tsg committed Aug 14, 2017
1 parent cc71fa1 commit 2df42cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ https://github.com/elastic/beats/compare/v6.0.0-beta1...master[Check the HEAD di

*Heartbeat*

- Fix wrong event timestamps. {issue}4851[4851]

*Metricbeat*

*Packetbeat*
Expand Down
12 changes: 5 additions & 7 deletions heartbeat/monitors/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ func MakeJob(settings JobSettings, f func() (common.MapStr, []TaskRunner, error)
},
})

return &funcJob{settings, annotated(settings, time.Now(), f)}
return &funcJob{settings, func() (beat.Event, []JobRunner, error) {
// Create and run new annotated Job whenever the Jobs root is Task is executed.
// This will set the jobs active start timestamp to the time.Now().
return annotated(settings, time.Now(), f)()
}}
}

// annotated lifts a TaskRunner into a job, annotating events with common fields and start timestamp.
Expand Down Expand Up @@ -406,12 +410,6 @@ func (f *funcJob) Run() (beat.Event, []JobRunner, error) { return f.run() }

func (f funcTask) Run() (common.MapStr, []TaskRunner, error) { return f.run() }

/*
func (f funcTask) annotated(settings JobSettings, start time.Time) TaskRunner {
return annotated(settings, start, f.run)
}
*/

// Unpack sets PingMode from a constant string. Unpack will be called by common.Unpack when
// unpacking into an IPSettings type.
func (p *PingMode) Unpack(s string) error {
Expand Down

0 comments on commit 2df42cc

Please sign in to comment.