File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed
opentelemetry_api_experimental/src
opentelemetry_experimental Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 4141
4242-type advisory_params () :: #{explicit_bucket_boundaries => [number (), ...]}.
4343
44- -type opts () :: #{description => description (),
45- unit => unit (),
46- advisory_params => advisory_params ()}.
44+ -type opts () :: #{description => description () | undefined ,
45+ unit => unit () | undefined ,
46+ advisory_params => advisory_params () | undefined }.
4747
4848-type t () :: # instrument {}.
4949
Original file line number Diff line number Diff line change 115115 {
116116 name :: otel_view :name (),
117117 scope :: opentelemetry :instrumentation_scope () | undefined ,
118- description :: otel_instrument :description (),
119- unit :: otel_instrument :unit (),
118+ description :: otel_instrument :description () | undefined ,
119+ unit :: otel_instrument :unit () | undefined ,
120120 data :: # sum {} | # gauge {} | # histogram {}
121121 }).
Original file line number Diff line number Diff line change @@ -63,11 +63,16 @@ to_proto(#metric{name=Name,
6363 data = Data }) ->
6464 Metric =
6565 #{name => otel_otlp_common :to_binary (Name ),
66- description => Description ,
6766 data => to_data (Data )},
68- case Unit of
69- undefined -> Metric ;
70- _ -> Metric #{unit => otel_otlp_common :to_binary (Unit )}
67+
68+ Metric1 = case Unit of
69+ undefined -> Metric ;
70+ _ -> Metric #{unit => otel_otlp_common :to_binary (Unit )}
71+ end ,
72+
73+ case Description of
74+ undefined -> Metric1 ;
75+ _ -> Metric1 #{description => Description }
7176 end .
7277
7378to_data (# sum {aggregation_temporality = Temporality ,
Original file line number Diff line number Diff line change 4949 criteria / 0 ,
5050 config / 0 ]).
5151
52- -eqwalizer ({nowarn_function , maybe_init_meter / 3 }).
53-
5452-include_lib (" opentelemetry_api/include/gradualizer.hrl" ).
5553
5654% % ignore dialyzer warnings in functions using matchspecs or related to those that do
@@ -182,6 +180,7 @@ criteria_to_instrument_matchspec(_) ->
182180 % % eqwalizer:ignore using ignore as an ets matchspec workaround
183181 ets :match_spec_compile ([{# instrument {_ = '_' }, [], [true ]}]).
184182
183+ % % eqwalizer:ignore using ignore as an ets matchspec workaround
185184maybe_init_meter (# instrument {meter = '_' }) ->
186185 % % eqwalizer:ignore using ignore as an ets matchspec workaround
187186 {'_' , # meter {instrumentation_scope = # instrumentation_scope {_ = '_' },
Original file line number Diff line number Diff line change @@ -1774,7 +1774,7 @@ async_cumulative_page_faults(_Config) ->
17741774
17751775 CounterName = page_faults ,
17761776 CounterDesc = <<" number of page faults" >>,
1777- CounterUnit = 1 ,
1777+ CounterUnit = '1' ,
17781778
17791779 ? assert (otel_meter_server :add_view (#{instrument_name => CounterName },
17801780 #{aggregation_module => otel_aggregation_sum })),
@@ -1834,7 +1834,7 @@ async_delta_page_faults(_Config) ->
18341834
18351835 CounterName = page_faults ,
18361836 CounterDesc = <<" number of page faults" >>,
1837- CounterUnit = 1 ,
1837+ CounterUnit = '1' ,
18381838
18391839 ? assert (otel_meter_server :add_view (#{instrument_name => CounterName },
18401840 #{aggregation_module => otel_aggregation_sum })),
@@ -1915,7 +1915,7 @@ async_attribute_removal(_Config) ->
19151915
19161916 CounterName = page_faults ,
19171917 CounterDesc = <<" number of page faults" >>,
1918- CounterUnit = 1 ,
1918+ CounterUnit = '1' ,
19191919
19201920 ? assert (otel_meter_server :add_view (#{instrument_name => CounterName },
19211921 #{aggregation_module => otel_aggregation_sum ,
You can’t perform that action at this time.
0 commit comments