diff --git a/apps/opentelemetry_experimental/include/otel_metrics.hrl b/apps/opentelemetry_experimental/include/otel_metrics.hrl index 96ad924c..085a70bd 100644 --- a/apps/opentelemetry_experimental/include/otel_metrics.hrl +++ b/apps/opentelemetry_experimental/include/otel_metrics.hrl @@ -28,8 +28,8 @@ { %% TODO: attributes should be a tuple of just the values, sorted by attribute name key :: key_match_spec() | undefined | {element, 2, '$_'}, - start_time_unix_nano :: match_spec(integer()) | undefined, - last_start_time_unix_nano :: match_spec(integer()) | undefined, + start_time :: match_spec(integer()) | undefined, + last_start_time :: match_spec(integer()) | undefined, checkpoint :: match_spec(number()) | undefined | {'+', '$2', '$3'} | {'+', '$3', '$4'}, previous_checkpoint :: match_spec(number()) | undefined | {'+', '$5', '$6'}, int_value :: match_spec(number()) | undefined | {'+', '$3', {const, number()}}, @@ -42,8 +42,8 @@ key :: key_match_spec() | undefined, checkpoint :: match_spec(number()) | undefined, value :: match_spec(number()) | undefined, - start_time_unix_nano :: match_spec(integer()) | undefined, - last_start_time_unix_nano :: match_spec(integer()) | undefined + start_time :: match_spec(integer()) | undefined, + last_start_time :: match_spec(integer()) | undefined }). @@ -53,14 +53,14 @@ min :: match_spec(number()) | undefined, max :: match_spec(number()) | undefined, sum :: match_spec(number()) | undefined, - start_time_unix_nano :: match_spec(number()) | undefined + start_time :: match_spec(number()) | undefined }). -record(explicit_histogram_aggregation, { %% TODO: attributes should be a tuple of just the values, sorted by attribute name key :: key_match_spec() | undefined, - start_time_unix_nano :: match_spec(integer()) | undefined, + start_time :: match_spec(integer()) | undefined, %% instrument_temporality :: otel_aggregation:temporality(), %% default: [0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 1000.0] explicit_bucket_boundaries :: match_spec([float()]) | undefined, @@ -75,8 +75,8 @@ -record(datapoint, { attributes :: opentelemetry:attributes_map(), - start_time_unix_nano :: integer(), - time_unix_nano :: integer(), + start_time :: integer(), + time :: integer(), value :: number(), exemplars :: list() | undefined, flags :: integer() %% uint32 @@ -97,8 +97,8 @@ -record(histogram_datapoint, { attributes :: opentelemetry:attributes_map(), - start_time_unix_nano :: match_spec(integer()) | {const, eqwalizer:dynamic()} | undefined, - time_unix_nano :: integer(), + start_time :: match_spec(integer()) | {const, eqwalizer:dynamic()} | undefined, + time :: integer(), count :: number(), sum :: float() | match_spec(integer()) | undefined, bucket_counts :: list(), diff --git a/apps/opentelemetry_experimental/src/otel_aggregation_histogram_explicit.erl b/apps/opentelemetry_experimental/src/otel_aggregation_histogram_explicit.erl index 68ef95e6..dc0e36fe 100644 --- a/apps/opentelemetry_experimental/src/otel_aggregation_histogram_explicit.erl +++ b/apps/opentelemetry_experimental/src/otel_aggregation_histogram_explicit.erl @@ -139,7 +139,7 @@ init(#view_aggregation{name=Name, ExplicitBucketBoundaries = maps:get(explicit_bucket_boundaries, Options, ?DEFAULT_BOUNDARIES), RecordMinMax = maps:get(record_min_max, Options, true), #explicit_histogram_aggregation{key=Key, - start_time_unix_nano=erlang:system_time(nanosecond), + start_time=opentelemetry:timestamp(), explicit_bucket_boundaries=ExplicitBucketBoundaries, bucket_counts=new_bucket_counts(ExplicitBucketBoundaries), checkpoint=undefined, @@ -177,9 +177,9 @@ aggregate(Table, #view_aggregation{name=Name, checkpoint(Tab, #view_aggregation{name=Name, reader=ReaderId, - temporality=?TEMPORALITY_DELTA}, CollectionStartNano) -> + temporality=?TEMPORALITY_DELTA}, CollectionStartTime) -> MS = [{#explicit_histogram_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$9', + start_time='$9', explicit_bucket_boundaries='$2', record_min_max='$3', checkpoint='_', @@ -190,14 +190,14 @@ checkpoint(Tab, #view_aggregation{name=Name, }, [], [{#explicit_histogram_aggregation{key={{{const, Name}, '$1', {const, ReaderId}}}, - start_time_unix_nano={const, CollectionStartNano}, + start_time={const, CollectionStartTime}, explicit_bucket_boundaries='$2', record_min_max='$3', checkpoint={#explicit_histogram_checkpoint{bucket_counts='$5', min='$6', max='$7', sum='$8', - start_time_unix_nano='$9'}}, + start_time='$9'}}, bucket_counts={const, undefined}, min=infinity, max=?MIN_DOUBLE, @@ -205,7 +205,7 @@ checkpoint(Tab, #view_aggregation{name=Name, _ = ets:select_replace(Tab, MS), ok; -checkpoint(_Tab, _, _CollectionStartNano) -> +checkpoint(_Tab, _, _CollectionStartTime) -> %% no good way to checkpoint the `counters' without being out of sync with %% min/max/sum, so may as well just collect them in `collect', which will %% also be out of sync, but best we can do right now @@ -216,7 +216,7 @@ collect(Tab, #view_aggregation{name=Name, reader=ReaderId, temporality=Temporality}, CollectionStartTime) -> Select = [{#explicit_histogram_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$2', + start_time='$2', explicit_bucket_boundaries='$3', record_min_max='$4', checkpoint='$5', @@ -230,10 +230,10 @@ collect(Tab, #view_aggregation{name=Name, %% -datapoint(CollectionStartNano, #explicit_histogram_aggregation{ +datapoint(CollectionStartTime, #explicit_histogram_aggregation{ key={_, Attributes, _}, explicit_bucket_boundaries=Boundaries, - start_time_unix_nano=StartTimeUnixNano, + start_time=StartTime, checkpoint=undefined, bucket_counts=BucketCounts, min=Min, @@ -243,8 +243,8 @@ datapoint(CollectionStartNano, #explicit_histogram_aggregation{ Buckets = get_buckets(BucketCounts, Boundaries), #histogram_datapoint{ attributes=Attributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, count=lists:sum(Buckets), sum=Sum, bucket_counts=Buckets, @@ -254,20 +254,20 @@ datapoint(CollectionStartNano, #explicit_histogram_aggregation{ min=Min, max=Max }; -datapoint(CollectionStartNano, #explicit_histogram_aggregation{ +datapoint(CollectionStartTime, #explicit_histogram_aggregation{ key={_, Attributes, _}, explicit_bucket_boundaries=Boundaries, checkpoint=#explicit_histogram_checkpoint{bucket_counts=BucketCounts, min=Min, max=Max, sum=Sum, - start_time_unix_nano=StartTimeUnixNano} + start_time=StartTime} }) -> Buckets = get_buckets(BucketCounts, Boundaries), #histogram_datapoint{ attributes=Attributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, count=lists:sum(Buckets), sum=Sum, bucket_counts=Buckets, diff --git a/apps/opentelemetry_experimental/src/otel_aggregation_last_value.erl b/apps/opentelemetry_experimental/src/otel_aggregation_last_value.erl index 697580f8..cde8e3b4 100644 --- a/apps/opentelemetry_experimental/src/otel_aggregation_last_value.erl +++ b/apps/opentelemetry_experimental/src/otel_aggregation_last_value.erl @@ -39,7 +39,7 @@ init(#view_aggregation{name=Name, aggregation_options=_Options}, Attributes) -> Key = {Name, Attributes, ReaderId}, #last_value_aggregation{key=Key, - start_time_unix_nano=erlang:system_time(nanosecond), + start_time=opentelemetry:timestamp(), value=undefined}. aggregate(Tab, ViewAggregation=#view_aggregation{name=Name, @@ -55,32 +55,32 @@ aggregate(Tab, ViewAggregation=#view_aggregation{name=Name, checkpoint(Tab, #view_aggregation{name=Name, reader=ReaderId, - temporality=?TEMPORALITY_DELTA}, CollectionStartNano) -> + temporality=?TEMPORALITY_DELTA}, CollectionStartTime) -> MS = [{#last_value_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$3', - last_start_time_unix_nano='_', + start_time='$3', + last_start_time='_', checkpoint='_', value='$2'}, [], [{#last_value_aggregation{key={{Name, '$1', {const, ReaderId}}}, - start_time_unix_nano={const, CollectionStartNano}, - last_start_time_unix_nano='$3', + start_time={const, CollectionStartTime}, + last_start_time='$3', checkpoint='$2', value='$2'}}]}], _ = ets:select_replace(Tab, MS), ok; checkpoint(Tab, #view_aggregation{name=Name, - reader=ReaderId}, _CollectionStartNano) -> + reader=ReaderId}, _CollectionStartTime) -> MS = [{#last_value_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$3', - last_start_time_unix_nano='_', + start_time='$3', + last_start_time='_', checkpoint='_', value='$2'}, [], [{#last_value_aggregation{key={{{const, Name}, '$1', {const, ReaderId}}}, - start_time_unix_nano='$3', - last_start_time_unix_nano='$3', + start_time='$3', + last_start_time='$3', checkpoint='$2', value='$2'}}]}], _ = ets:select_replace(Tab, MS), @@ -93,23 +93,23 @@ collect(Tab, #view_aggregation{name=Name, Select = [{#last_value_aggregation{key={Name, '$1', ReaderId}, checkpoint='$2', value='$3', - start_time_unix_nano='$4', - last_start_time_unix_nano='$5'}, [], ['$_']}], + start_time='$4', + last_start_time='$5'}, [], ['$_']}], AttributesAggregation = ets:select(Tab, Select), #gauge{datapoints=[datapoint(CollectionStartTime, LastValueAgg) || LastValueAgg <- AttributesAggregation]}. %% -datapoint(CollectionStartNano, #last_value_aggregation{key={_, Attributes, _}, - last_start_time_unix_nano=StartTimeUnixNano, +datapoint(CollectionStartTime, #last_value_aggregation{key={_, Attributes, _}, + last_start_time=StartTime, checkpoint=Checkpoint}) -> #datapoint{attributes=Attributes, - %% `start_time_unix_nano' being set to `last_start_time_unix_nano' causes complaints - %% because `last_start_time_unix_nano' has matchspec values in its typespec + %% `start_time' being set to `last_start_time' causes complaints + %% because `last_start_time' has matchspec values in its typespec %% eqwalizer:ignore see above - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, %% eqwalizer:ignore more matchspec fun value=Checkpoint, exemplars=[], diff --git a/apps/opentelemetry_experimental/src/otel_aggregation_sum.erl b/apps/opentelemetry_experimental/src/otel_aggregation_sum.erl index 16865948..2bcf9b6b 100644 --- a/apps/opentelemetry_experimental/src/otel_aggregation_sum.erl +++ b/apps/opentelemetry_experimental/src/otel_aggregation_sum.erl @@ -36,7 +36,7 @@ init(#view_aggregation{name=Name, reader=ReaderId}, Attributes) -> Key = {Name, Attributes, ReaderId}, #sum_aggregation{key=Key, - start_time_unix_nano=erlang:system_time(nanosecond), + start_time=opentelemetry:timestamp(), checkpoint=0, %% 0 value is never reported but gets copied to previous_checkpoint %% which is used to add/subtract for conversion of temporality previous_checkpoint=0, @@ -70,16 +70,16 @@ aggregate(Tab, #view_aggregation{name=Name, when (IsMonotonic andalso Value >= 0.0) orelse not IsMonotonic -> Key = {Name, Attributes, ReaderId}, MS = [{#sum_aggregation{key=Key, - start_time_unix_nano='$1', - last_start_time_unix_nano='$5', + start_time='$1', + last_start_time='$5', checkpoint='$2', previous_checkpoint='$6', int_value='$3', float_value='$4'}, [], [{#sum_aggregation{key={element, 2, '$_'}, - start_time_unix_nano='$1', - last_start_time_unix_nano='$5', + start_time='$1', + last_start_time='$5', checkpoint='$2', previous_checkpoint='$6', int_value='$3', @@ -91,33 +91,33 @@ aggregate(_Tab, #view_aggregation{name=_Name, checkpoint(Tab, #view_aggregation{name=Name, reader=ReaderId, - temporality=?TEMPORALITY_DELTA}, CollectionStartNano) -> + temporality=?TEMPORALITY_DELTA}, CollectionStartTime) -> MS = [{#sum_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$4', - last_start_time_unix_nano='_', + start_time='$4', + last_start_time='_', checkpoint='$5', previous_checkpoint='_', int_value='$2', float_value='$3'}, [{'=:=', '$3', {const, 0.0}}], [{#sum_aggregation{key={{Name, '$1', {const, ReaderId}}}, - start_time_unix_nano={const, CollectionStartNano}, - last_start_time_unix_nano='$4', + start_time={const, CollectionStartTime}, + last_start_time='$4', checkpoint='$2', previous_checkpoint='$5', int_value=0, float_value=0.0}}]}, {#sum_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$4', - last_start_time_unix_nano='_', + start_time='$4', + last_start_time='_', checkpoint='$5', previous_checkpoint='_', int_value='$2', float_value='$3'}, [], [{#sum_aggregation{key={{Name, '$1', {const, ReaderId}}}, - start_time_unix_nano={const, CollectionStartNano}, - last_start_time_unix_nano='$4', + start_time={const, CollectionStartTime}, + last_start_time='$4', checkpoint={'+', '$2', '$3'}, previous_checkpoint='$5', int_value=0, @@ -126,33 +126,33 @@ checkpoint(Tab, #view_aggregation{name=Name, ok; checkpoint(Tab, #view_aggregation{name=Name, reader=ReaderId, - temporality=?TEMPORALITY_CUMULATIVE}, _CollectionStartNano) -> + temporality=?TEMPORALITY_CUMULATIVE}, _CollectionStartTime) -> MS = [{#sum_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$2', - last_start_time_unix_nano='_', + start_time='$2', + last_start_time='_', checkpoint='$5', previous_checkpoint='$6', int_value='$3', float_value='$4'}, [{'=:=', '$4', {const, 0.0}}], [{#sum_aggregation{key={{Name, '$1', {const, ReaderId}}}, - start_time_unix_nano='$2', - last_start_time_unix_nano='$2', + start_time='$2', + last_start_time='$2', checkpoint='$3', previous_checkpoint={'+', '$5', '$6'}, int_value=0, float_value=0.0}}]}, {#sum_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$2', - last_start_time_unix_nano='_', + start_time='$2', + last_start_time='_', checkpoint='$5', previous_checkpoint='$6', int_value='$3', float_value='$4'}, [], [{#sum_aggregation{key={{Name, '$1', {const, ReaderId}}}, - start_time_unix_nano='$2', - last_start_time_unix_nano='$2', + start_time='$2', + last_start_time='$2', checkpoint={'+', '$3', '$4'}, previous_checkpoint={'+', '$5', '$6'}, int_value=0, @@ -167,8 +167,8 @@ collect(Tab, #view_aggregation{name=Name, is_monotonic=IsMonotonic}, CollectionStartTime) -> Select = [{#sum_aggregation{key={Name, '$1', ReaderId}, - start_time_unix_nano='$2', - last_start_time_unix_nano='$3', + start_time='$2', + last_start_time='$3', checkpoint='$4', previous_checkpoint='$5', int_value='$6', @@ -178,42 +178,42 @@ collect(Tab, #view_aggregation{name=Name, is_monotonic=IsMonotonic, datapoints=[datapoint(CollectionStartTime, InstrumentTemporality, Temporality, SumAgg) || SumAgg <- AttributesAggregation]}. -datapoint(CollectionStartNano, Temporality, Temporality, #sum_aggregation{key={_, Attributes, _}, - last_start_time_unix_nano=StartTimeUnixNano, +datapoint(CollectionStartTime, Temporality, Temporality, #sum_aggregation{key={_, Attributes, _}, + last_start_time=StartTime, checkpoint=Value}) -> #datapoint{ %% eqwalizer:ignore something attributes=Attributes, %% eqwalizer:ignore something - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, %% eqwalizer:ignore something value=Value, exemplars=[], flags=0 }; -datapoint(CollectionStartNano, _, ?TEMPORALITY_CUMULATIVE, #sum_aggregation{key={_, Attributes, _}, - last_start_time_unix_nano=StartTimeUnixNano, +datapoint(CollectionStartTime, _, ?TEMPORALITY_CUMULATIVE, #sum_aggregation{key={_, Attributes, _}, + last_start_time=StartTime, previous_checkpoint=PreviousCheckpoint, checkpoint=Value}) -> #datapoint{ %% eqwalizer:ignore something attributes=Attributes, %% eqwalizer:ignore something - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, value=Value + PreviousCheckpoint, exemplars=[], flags=0 }; -datapoint(CollectionStartNano, _, ?TEMPORALITY_DELTA, #sum_aggregation{key={_, Attributes, _}, - last_start_time_unix_nano=StartTimeUnixNano, +datapoint(CollectionStartTime, _, ?TEMPORALITY_DELTA, #sum_aggregation{key={_, Attributes, _}, + last_start_time=StartTime, previous_checkpoint=PreviousCheckpoint, checkpoint=Value}) -> #datapoint{ attributes=Attributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, value=Value - PreviousCheckpoint, exemplars=[], flags=0 diff --git a/apps/opentelemetry_experimental/src/otel_metric_exporter_console.erl b/apps/opentelemetry_experimental/src/otel_metric_exporter_console.erl index 08979745..f307de1e 100644 --- a/apps/opentelemetry_experimental/src/otel_metric_exporter_console.erl +++ b/apps/opentelemetry_experimental/src/otel_metric_exporter_console.erl @@ -55,8 +55,8 @@ print_metric(Name, #histogram{datapoints=Datapoints}) -> print_datapoint(Name, #datapoint{ attributes=Attributes, - start_time_unix_nano=_StartTimeUnixNano, - time_unix_nano=_CollectionStartNano, + start_time=_StartTime, + time=_CollectionStartTime, value=Value, exemplars=_, flags=_ @@ -66,8 +66,8 @@ print_datapoint(Name, #datapoint{ print_histogram_datapoint(Name, #histogram_datapoint{ attributes=Attributes, - start_time_unix_nano=_StartTimeUnixNano, - time_unix_nano=_CollectionStartNano, + start_time=_StartTime, + time=_CollectionStartTime, count=_Count, sum=_Sum, bucket_counts=Buckets, diff --git a/apps/opentelemetry_experimental/src/otel_metric_reader.erl b/apps/opentelemetry_experimental/src/otel_metric_reader.erl index 628a0e01..26c814a1 100644 --- a/apps/opentelemetry_experimental/src/otel_metric_reader.erl +++ b/apps/opentelemetry_experimental/src/otel_metric_reader.erl @@ -188,7 +188,7 @@ collect_(CallbacksTab, ViewAggregationTab, MetricsTab, ReaderId) -> %% get the collection start time after running callbacks so any initialized %% metrics have a start time before the collection start time. - CollectionStartTime = erlang:system_time(nanosecond), + CollectionStartTime = opentelemetry:timestamp(), collect_(CallbacksTab, ViewAggregationTab, MetricsTab, CollectionStartTime, ReaderId, [], Key). run_callbacks(ReaderId, CallbacksTab, ViewAggregationTab, MetricsTab) -> diff --git a/apps/opentelemetry_experimental/src/otel_otlp_metrics.erl b/apps/opentelemetry_experimental/src/otel_otlp_metrics.erl index ec3e43e7..1115010c 100644 --- a/apps/opentelemetry_experimental/src/otel_otlp_metrics.erl +++ b/apps/opentelemetry_experimental/src/otel_otlp_metrics.erl @@ -79,15 +79,15 @@ to_data(#histogram{datapoints=Datapoints, aggregation_temporality => to_otlp_temporality(Temporality)}}. to_data_points(#datapoint{attributes=Attributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, value=Value, exemplars=Exemplars, flags=Flags }) -> #{attributes => otel_otlp_common:to_attributes(Attributes), - start_time_unix_nano => opentelemetry:timestamp_to_nano(StartTimeUnixNano), - time_unix_nano => opentelemetry:timestamp_to_nano(CollectionStartNano), + start_time => opentelemetry:timestamp_to_nano(StartTime), + time => opentelemetry:timestamp_to_nano(CollectionStartTime), value => to_datapoint_value(Value), exemplars => Exemplars, flags => Flags @@ -95,8 +95,8 @@ to_data_points(#datapoint{attributes=Attributes, to_histogram_data_points(#histogram_datapoint{ attributes=Attributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=CollectionStartNano, + start_time=StartTime, + time=CollectionStartTime, count=Count, sum=Sum, bucket_counts=Buckets, @@ -107,8 +107,8 @@ to_histogram_data_points(#histogram_datapoint{ max=Max }) -> #{attributes => otel_otlp_common:to_attributes(Attributes), - start_time_unix_nano => StartTimeUnixNano, - time_unix_nano => CollectionStartNano, + start_time => StartTime, + time => CollectionStartTime, count => Count, sum => Sum, bucket_counts => Buckets, diff --git a/apps/opentelemetry_experimental/test/otel_metrics_SUITE.erl b/apps/opentelemetry_experimental/test/otel_metrics_SUITE.erl index afd997e1..47bf87a8 100644 --- a/apps/opentelemetry_experimental/test/otel_metrics_SUITE.erl +++ b/apps/opentelemetry_experimental/test/otel_metrics_SUITE.erl @@ -27,8 +27,8 @@ lists:sort([{MetricValue, MetricAttributes} || #datapoint{value=MetricValue, attributes=MetricAttributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=TimeUnixNano} <- MetricDatapoints, StartTimeUnixNano =< TimeUnixNano]), + start_time=StartTime, + time=Time} <- MetricDatapoints, StartTime =< Time]), ?assertMatch([], lists:sort(Datapoints) -- SortedDatapoints, SortedDatapoints) after 5000 -> @@ -52,8 +52,8 @@ lists:sort([{MetricValue, MetricAttributes} || #datapoint{value=MetricValue, attributes=MetricAttributes, - start_time_unix_nano=StartTimeUnixNano, - time_unix_nano=TimeUnixNano} <- MetricDatapoints, StartTimeUnixNano =< TimeUnixNano]), + start_time=StartTime, + time=Time} <- MetricDatapoints, StartTime =< Time]), ?assertMatch([], lists:sort(Datapoints) -- SortedDatapoints, SortedDatapoints) after 5000 -> diff --git a/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl b/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl index 30bb2cdd..fc4ac597 100644 --- a/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl +++ b/apps/opentelemetry_exporter/test/opentelemetry_exporter_SUITE.erl @@ -81,8 +81,8 @@ verify_metrics_export(Config) -> datapoints=[#datapoint{ attributes=otel_attributes:new(#{<<"key-1">> => <<"value-1">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), value=5, exemplars=[], flags=0 @@ -90,8 +90,8 @@ verify_metrics_export(Config) -> #datapoint{ attributes=otel_attributes:new(#{<<"key-2">> => <<"value-2">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), value=8, exemplars=[], flags=0 @@ -105,8 +105,8 @@ verify_metrics_export(Config) -> data = #gauge{datapoints=[#datapoint{ attributes=otel_attributes:new(#{<<"key-1">> => <<"value-1">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), value=8, exemplars=[], flags=0 @@ -114,8 +114,8 @@ verify_metrics_export(Config) -> #datapoint{ attributes=otel_attributes:new(#{<<"key-2">> => <<"value-2">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), value=9, exemplars=[], flags=0 @@ -130,8 +130,8 @@ verify_metrics_export(Config) -> datapoints=[#histogram_datapoint{ attributes=otel_attributes:new(#{<<"key-1">> => <<"value-1">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), count = 3, sum = 9, bucket_counts = [1,1,1], @@ -144,8 +144,8 @@ verify_metrics_export(Config) -> #histogram_datapoint{ attributes=otel_attributes:new(#{<<"key-2">> => <<"value-2">>}, 128, 128), - start_time_unix_nano=opentelemetry:timestamp(), - time_unix_nano=opentelemetry:timestamp(), + start_time=opentelemetry:timestamp(), + time=opentelemetry:timestamp(), count = 3, sum = 9, bucket_counts = [1,1,1],