otlpmetric: StartTimeUnixNano for Gauge metric points is always set to "11651379494838206464" #4268
Labels
area:metrics
Part of OpenTelemetry Metrics
bug
Something isn't working
pkg:exporter:otlp
Related to the OTLP exporter package
Milestone
Repro steps
Code:
Add a breakpoint here:
opentelemetry-go/exporters/otlp/otlpmetric/internal/exporter.go
Lines 54 to 56 in 8e25817
Actual
You will notice that the input (
rm *metricdata.ResourceMetrics
) contains z zero value oftime.Time
forStartTime
and after serializing to proto the payload containsStartTimeUnixNano = 11651379494838206464
which is far from being correct:Tue 21 March 2339 22:18:14.838 UTC
Expected
transform.ResourceMetrics(rm)
to properly handletime.Time
zero values. Take notice: https://pkg.go.dev/time#Time.UnixNano. Probably we could setStartTimeUnixNano = 0
.StartTime
could be set as suggested per specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#gauge. EDIT: I created sdk/metric: Set StartTime for gauge metric points #4269Discussed in #4265
@anil181 thank you for reporting the issue.
The text was updated successfully, but these errors were encountered: