Skip to content

Commit

Permalink
Merge pull request #648 from SergeTupchiy/fix-metrics-timestamp-follo…
Browse files Browse the repository at this point in the history
…w-up-fix

fix(otel_otlp_metrics): convert histogram timestamps and fix 'unix_nano' field names
  • Loading branch information
tsloughter authored Nov 19, 2023
2 parents 41c793c + 02786fa commit a79a39f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/opentelemetry_experimental/src/otel_otlp_metrics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ to_data_points(#datapoint{attributes=Attributes,
exemplars=Exemplars,
flags=Flags
}) ->

#{attributes => otel_otlp_common:to_attributes(Attributes),
start_time => opentelemetry:timestamp_to_nano(StartTime),
time => opentelemetry:timestamp_to_nano(CollectionStartTime),
start_time_unix_nano => opentelemetry:timestamp_to_nano(StartTime),
time_unix_nano => opentelemetry:timestamp_to_nano(CollectionStartTime),
value => to_datapoint_value(Value),
exemplars => Exemplars,
flags => Flags
Expand All @@ -107,8 +108,8 @@ to_histogram_data_points(#histogram_datapoint{
max=Max
}) ->
#{attributes => otel_otlp_common:to_attributes(Attributes),
start_time => StartTime,
time => CollectionStartTime,
start_time_unix_nano => opentelemetry:timestamp_to_nano(StartTime),
time_unix_nano => opentelemetry:timestamp_to_nano(CollectionStartTime),
count => Count,
sum => Sum,
bucket_counts => Buckets,
Expand Down

0 comments on commit a79a39f

Please sign in to comment.