We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c3db261 + cb0f9ac commit c1ccdffCopy full SHA for c1ccdff
apps/opentelemetry_experimental/src/otel_otlp_metrics.erl
@@ -60,10 +60,14 @@ to_proto(#metric{name=Name,
60
description=Description,
61
unit=Unit,
62
data=Data}) ->
63
- #{name => otel_otlp_common:to_binary(Name),
64
- description => Description,
65
- unit => otel_otlp_common:to_binary(Unit),
66
- data => to_data(Data)}.
+ Metric =
+ #{name => otel_otlp_common:to_binary(Name),
+ description => Description,
+ data => to_data(Data)},
67
+ case Unit of
68
+ undefined -> Metric;
69
+ _ -> Metric#{unit => otel_otlp_common:to_binary(Unit)}
70
+ end.
71
72
to_data(#sum{aggregation_temporality=Temporality,
73
is_monotonic=IsMonotonic,
0 commit comments