Skip to content

Commit a79a39f

Browse files
authored
Merge pull request #648 from SergeTupchiy/fix-metrics-timestamp-follow-up-fix
fix(otel_otlp_metrics): convert histogram timestamps and fix 'unix_nano' field names
2 parents 41c793c + 02786fa commit a79a39f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/opentelemetry_experimental/src/otel_otlp_metrics.erl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ to_data_points(#datapoint{attributes=Attributes,
8585
exemplars=Exemplars,
8686
flags=Flags
8787
}) ->
88+
8889
#{attributes => otel_otlp_common:to_attributes(Attributes),
89-
start_time => opentelemetry:timestamp_to_nano(StartTime),
90-
time => opentelemetry:timestamp_to_nano(CollectionStartTime),
90+
start_time_unix_nano => opentelemetry:timestamp_to_nano(StartTime),
91+
time_unix_nano => opentelemetry:timestamp_to_nano(CollectionStartTime),
9192
value => to_datapoint_value(Value),
9293
exemplars => Exemplars,
9394
flags => Flags
@@ -107,8 +108,8 @@ to_histogram_data_points(#histogram_datapoint{
107108
max=Max
108109
}) ->
109110
#{attributes => otel_otlp_common:to_attributes(Attributes),
110-
start_time => StartTime,
111-
time => CollectionStartTime,
111+
start_time_unix_nano => opentelemetry:timestamp_to_nano(StartTime),
112+
time_unix_nano => opentelemetry:timestamp_to_nano(CollectionStartTime),
112113
count => Count,
113114
sum => Sum,
114115
bucket_counts => Buckets,

0 commit comments

Comments
 (0)