Use nanosecond precision in docker_log input (#6663)

This commit is contained in:
Daniel Nelson 2019-11-18 10:24:22 -08:00 committed by GitHub
parent a9ec5fc209
commit 1700cfb1c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -203,6 +203,7 @@ func (d *DockerLogs) matchedContainerName(names []string) string {
func (d *DockerLogs) Gather(acc telegraf.Accumulator) error { func (d *DockerLogs) Gather(acc telegraf.Accumulator) error {
ctx := context.Background() ctx := context.Background()
acc.SetPrecision(time.Nanosecond)
ctx, cancel := context.WithTimeout(ctx, d.Timeout.Duration) ctx, cancel := context.WithTimeout(ctx, d.Timeout.Duration)
defer cancel() defer cancel()