diff --git a/receiver/telegrafreceiver/converter.go b/receiver/telegrafreceiver/converter.go index 632b297525d7..4931f76c0797 100644 --- a/receiver/telegrafreceiver/converter.go +++ b/receiver/telegrafreceiver/converter.go @@ -80,7 +80,7 @@ func (mc metricConverter) Convert(m telegraf.Metric) (pdata.Metrics, error) { dps.Resize(1) dp := dps.At(0) dp.SetValue(v) - dp.SetTimestamp(pdata.TimestampUnixNano(tim)) + dp.SetTimestamp(pdata.Timestamp(tim)) if mc.separateField { dp.LabelsMap().Insert(fieldLabel, f.Key) } @@ -97,7 +97,7 @@ func (mc metricConverter) Convert(m telegraf.Metric) (pdata.Metrics, error) { dp.SetValue(int64(vv)) } - dp.SetTimestamp(pdata.TimestampUnixNano(tim)) + dp.SetTimestamp(pdata.Timestamp(tim)) if mc.separateField { dp.LabelsMap().Insert(fieldLabel, f.Key) } diff --git a/receiver/telegrafreceiver/converter_test.go b/receiver/telegrafreceiver/converter_test.go index 76dd279072d4..bd8491bfae8e 100644 --- a/receiver/telegrafreceiver/converter_test.go +++ b/receiver/telegrafreceiver/converter_test.go @@ -342,7 +342,7 @@ func newMetricIntGauge(metric string, value int64, t time.Time) pdata.Metric { dps.Resize(1) dp := dps.At(0) dp.SetValue(value) - dp.SetTimestamp(pdata.TimestampUnixNano(t.UnixNano())) + dp.SetTimestamp(pdata.Timestamp(t.UnixNano())) return pm } @@ -355,7 +355,7 @@ func newMetricIntGaugeWithSeparateField(metric string, field string, value int64 dps.Resize(1) dp := dps.At(0) dp.SetValue(value) - dp.SetTimestamp(pdata.TimestampUnixNano(t.UnixNano())) + dp.SetTimestamp(pdata.Timestamp(t.UnixNano())) dp.LabelsMap().Insert(fieldLabel, field) return pm } @@ -369,7 +369,7 @@ func newMetricDoubleGauge(metric string, value float64, t time.Time) pdata.Metri dps.Resize(1) dp := dps.At(0) dp.SetValue(value) - dp.SetTimestamp(pdata.TimestampUnixNano(t.UnixNano())) + dp.SetTimestamp(pdata.Timestamp(t.UnixNano())) return pm } @@ -382,7 +382,7 @@ func newMetricDoubleGaugeWithSeparateField(metric string, field string, value fl dps.Resize(1) dp := dps.At(0) dp.SetValue(value) - dp.SetTimestamp(pdata.TimestampUnixNano(t.UnixNano())) + dp.SetTimestamp(pdata.Timestamp(t.UnixNano())) dp.LabelsMap().Insert(fieldLabel, field) return pm } diff --git a/receiver/telegrafreceiver/go.mod b/receiver/telegrafreceiver/go.mod index 763b2c8e9b9d..e099d80374f6 100644 --- a/receiver/telegrafreceiver/go.mod +++ b/receiver/telegrafreceiver/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( github.com/influxdata/telegraf v1.17.3 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/collector v0.21.0 + go.opentelemetry.io/collector v0.22.0 go.uber.org/zap v1.16.0 )