|
| 1 | +-include_lib("opentelemetry_api_experimental/include/match_spec.hrl"). |
| 2 | + |
1 | 3 | -define(DEFAULT_METER_PROVIDER, otel_meter_provider_default).
|
2 | 4 |
|
3 |
| --type match_var() :: '_' | '$1' | '$2' | '$3' | '$4' | '$5' | '$6' | '$7' | '$8' | '$9'. |
4 |
| --type match_expr(A) :: undefined | match_var() | {const, A}. |
5 |
| --type match_spec(A) :: match_expr(A). |
| 5 | +-type key_inner_match_spec() :: {match_spec(atom()), match_spec(opentelemetry:attributes_map()), match_spec(reference())}. |
| 6 | +-type key_match_spec() :: match_spec(otel_aggregation:key()) | key_inner_match_spec() | {key_inner_match_spec()}. |
6 | 7 |
|
7 | 8 | -record(meter,
|
8 | 9 | {
|
|
26 | 27 | -record(sum_aggregation,
|
27 | 28 | {
|
28 | 29 | %% TODO: attributes should be a tuple of just the values, sorted by attribute name
|
29 |
| - key :: otel_aggregation:key() | otel_aggregation:key_match_spec() | {element, 2, '$_'}, |
30 |
| - start_time_unix_nano :: integer() | match_spec(integer()), |
31 |
| - last_start_time_unix_nano :: integer() | match_spec(integer()), |
32 |
| - checkpoint :: number() | match_spec(number()) | {'+', '$2', '$3'} | {'+', '$3', '$4'}, |
33 |
| - previous_checkpoint :: number() | match_spec(number()) | {'+', '$5', '$6'}, |
34 |
| - int_value :: number() | match_spec(number()) | {'+', '$3', {const, number()}}, |
35 |
| - float_value :: number() | match_spec(number()) | {'+', '$4', {const, number()}} |
| 30 | + key :: key_match_spec() | undefined | {element, 2, '$_'}, |
| 31 | + start_time_unix_nano :: match_spec(integer()) | undefined, |
| 32 | + last_start_time_unix_nano :: match_spec(integer()) | undefined, |
| 33 | + checkpoint :: match_spec(number()) | undefined | {'+', '$2', '$3'} | {'+', '$3', '$4'}, |
| 34 | + previous_checkpoint :: match_spec(number()) | undefined | {'+', '$5', '$6'}, |
| 35 | + int_value :: match_spec(number()) | undefined | {'+', '$3', {const, number()}}, |
| 36 | + float_value :: match_spec(number()) | undefined | {'+', '$4', {const, number()}} |
36 | 37 | }).
|
37 | 38 |
|
38 | 39 | -record(last_value_aggregation,
|
39 | 40 | {
|
40 | 41 | %% TODO: attributes should be a tuple of just the values, sorted by attribute name
|
41 |
| - key :: otel_aggregation:key() | otel_aggregation:key_match_spec(), |
42 |
| - checkpoint :: number() | match_spec(number()), |
43 |
| - value :: number() | match_spec(number()), |
44 |
| - start_time_unix_nano :: integer() | match_spec(integer()), |
45 |
| - last_start_time_unix_nano :: integer() | match_spec(integer()) |
| 42 | + key :: key_match_spec() | undefined, |
| 43 | + checkpoint :: match_spec(number()) | undefined, |
| 44 | + value :: match_spec(number()) | undefined, |
| 45 | + start_time_unix_nano :: match_spec(integer()) | undefined, |
| 46 | + last_start_time_unix_nano :: match_spec(integer()) | undefined |
46 | 47 | }).
|
47 | 48 |
|
48 | 49 |
|
49 | 50 | -record(explicit_histogram_checkpoint,
|
50 | 51 | {
|
51 |
| - bucket_counts :: counters:counters_ref() | match_spec(counters:counters_ref()), |
52 |
| - min :: number() | match_spec(number()), |
53 |
| - max :: number() | match_spec(number()), |
54 |
| - sum :: number() | match_spec(number()), |
55 |
| - start_time_unix_nano :: integer() | match_spec(number()) |
| 52 | + bucket_counts :: match_spec(counters:counters_ref()) | undefined, |
| 53 | + min :: match_spec(number()) | undefined, |
| 54 | + max :: match_spec(number()) | undefined, |
| 55 | + sum :: match_spec(number()) | undefined, |
| 56 | + start_time_unix_nano :: match_spec(number()) | undefined |
56 | 57 | }).
|
57 | 58 |
|
58 | 59 | -record(explicit_histogram_aggregation,
|
59 | 60 | {
|
60 | 61 | %% TODO: attributes should be a tuple of just the values, sorted by attribute name
|
61 |
| - key :: otel_aggregation:key() | otel_aggregation:key_match_spec(), |
62 |
| - start_time_unix_nano :: integer() | {const, eqwalizer:dynamic()} | '$9' | '$2' | undefined, |
| 62 | + key :: key_match_spec() | undefined, |
| 63 | + start_time_unix_nano :: match_spec(integer()) | undefined, |
63 | 64 | %% instrument_temporality :: otel_aggregation:temporality(),
|
64 | 65 | %% default: [0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 1000.0]
|
65 |
| - explicit_bucket_boundaries :: [float()] | match_spec([float()]), |
66 |
| - record_min_max :: boolean() | match_spec(boolean()), |
67 |
| - checkpoint :: #explicit_histogram_checkpoint{} | match_spec(#explicit_histogram_checkpoint{}) | {#explicit_histogram_checkpoint{}}, |
| 66 | + explicit_bucket_boundaries :: match_spec([float()]) | undefined, |
| 67 | + record_min_max :: match_spec(boolean()) | undefined, |
| 68 | + checkpoint :: match_spec(#explicit_histogram_checkpoint{}) | {#explicit_histogram_checkpoint{}} | undefined, |
68 | 69 | bucket_counts :: counters:counters_ref() | match_spec(undefined),
|
69 |
| - min :: number() | infinity | match_spec(number()), |
70 |
| - max :: number() | match_spec(number()), |
71 |
| - sum :: number() | match_spec(number()) |
| 70 | + min :: infinity | match_spec(number()) | undefined, |
| 71 | + max :: match_spec(number()) | undefined, |
| 72 | + sum :: match_spec(number()) | undefined |
72 | 73 | }).
|
73 | 74 |
|
74 | 75 | -record(datapoint,
|
|
96 | 97 | -record(histogram_datapoint,
|
97 | 98 | {
|
98 | 99 | attributes :: opentelemetry:attributes_map(),
|
99 |
| - start_time_unix_nano :: integer() | match_spec(integer()) | {const, eqwalizer:dynamic()}, |
| 100 | + start_time_unix_nano :: match_spec(integer()) | {const, eqwalizer:dynamic()} | undefined, |
100 | 101 | time_unix_nano :: integer(),
|
101 | 102 | count :: number(),
|
102 |
| - sum :: float() | match_spec(integer()), |
| 103 | + sum :: float() | match_spec(integer()) | undefined, |
103 | 104 | bucket_counts :: list(),
|
104 |
| - explicit_bounds :: [float()] | match_spec([float()]), |
| 105 | + explicit_bounds :: match_spec([float()]) | undefined, |
105 | 106 | exemplars :: list(),
|
106 | 107 | flags :: integer(),
|
107 |
| - min :: integer() | infinity | match_spec(integer()), |
108 |
| - max :: integer() | match_spec(integer()) |
| 108 | + min :: infinity | match_spec(integer()) | undefined, |
| 109 | + max :: match_spec(integer()) | undefined |
109 | 110 | }).
|
110 | 111 |
|
111 | 112 | -record(histogram,
|
|
0 commit comments