include/otel_value.h

filter: Statementstmt 99.3% 149 / 150 Branchbran 79.7% 110 / 138 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 89.9% 259 / 288 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« include/otel_semconv.h ↑ Summary include/otel_tracer.h »
1 /* otel_value.h - AnyValue and KeyValue, from Perl scalars.
2 *
3 * Every attribute in every signal goes through here, which makes this both
4 * the most-exercised code in the encoder and the easiest to get subtly wrong.
5 *
6 * AnyValue is a protobuf oneof over string, bool, int, double, array, kvlist
7 * and bytes, and Perl scalars do not map onto it cleanly: a scalar can be an
8 * IV and a PV at once, "3" and 3 are the same value with different histories,
9 * and undef is not a member of the union at all. The rules below are chosen
10 * so that a value round-trips as the type the application meant, and so that
11 * the two encoders (protobuf here, JSON in otel_json.h) agree - a value that
12 * arrives at a collector as an int over one transport and a string over the
13 * other is a bug nobody finds until a dashboard filter stops matching.
14 *
15 * THE RULES, in order:
16 * 1. undef -> an AnyValue with NOTHING set. That is the protobuf
17 * spelling of a null attribute; it is not the same as an
18 * empty string and must not become one.
19 * 2. a bool ref -> bool. \1 and \0 are the JSON-boolean convention the
20 * rest of this ecosystem already uses (File::Raw::JSON
21 * encodes a scalar ref as true/false), so honouring it
22 * here keeps one convention across the dist.
23 * 3. any BLESSED -> its stringification. An object is a value, not a
24 * ref structure: one with an overloaded "" is a perfectly
25 * ordinary thing to attach to a span, and dumping its
26 * guts as a KeyValueList instead would be a silent
27 * change of meaning. This is the same rule Punk::Logger
28 * applies to a blessed reference, and the two agreeing
29 * matters more than either being clever.
30 * 4. arrayref -> ArrayValue, recursively (unblessed only).
31 * 5. hashref -> KeyValueList, recursively (unblessed only).
32 * 6. other ref -> its stringification. A coderef is a mistake that must
33 * not take the request down - the same discipline
34 * Punk::Logger's scrubber applies, learned the same way.
35 * 7. IOK, not POK -> int. An integer that has never been used as a string.
36 * 8. NOK, not POK -> double.
37 * 9. anything else-> string. Including a scalar that is both: if it has a
38 * string form, the application has treated it as text,
39 * and text is the safe answer. Guessing "3" into an int
40 * changes an id into a number and breaks grouping.
41 */
42  
43 #ifndef OTEL_VALUE_H
44 #define OTEL_VALUE_H
45  
46 #include "otel_pb.h"
47 #include "otel_proto.h"
48  
49 static size_t otel_anyvalue_size(pTHX_ SV *v);
50 static void otel_anyvalue_write(pTHX_ otel_buf *b, SV *v);
51  
52 /* What an AnyValue IS, decided in exactly one place.
53 *
54 * Both encoders - protobuf here, OTLP/JSON in otel_json.h - classify through
55 * this function rather than each applying the rules above themselves. If they
56 * did it twice the two would drift, and the drift would be invisible: a value
57 * arriving at a collector as an int over one transport and a string over the
58 * other is a bug nobody finds until a dashboard filter quietly stops
59 * matching. One classifier, two renderings. */
60 enum {
61 OTV_NULL = 0, /* undef: an AnyValue with nothing set */
62 OTV_BOOL,
63 OTV_INT,
64 OTV_DOUBLE,
65 OTV_ARRAY,
66 OTV_KVLIST,
67 OTV_STRING /* includes every ref that is not a plain container */
68 };
69  
70 /* Is this ref one of the two boolean spellings, \1 and \0? A ref to a plain
71 * scalar holding 0 or 1 and nothing else. */
72 65 static int otel_is_bool(pTHX_ SV *rv) {
73 SV *inner;
74 65 ▶ if (!SvROK(rv)) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (!SvROK(rv)) return 0; 0 65 65
75 65 inner = SvRV(rv);
76 65 ▶ if (SvTYPE(inner) > SVt_PVMG || SvROK(inner)) return 0;
Branch: 2 branches
BranchTrueFalseTotal
if (SvTYPE(inner) > SVt_PVMG || SvROK(inner)) return 0; 25 40 65
if (SvTYPE(inner) > SVt_PVMG || SvROK(inner)) return 0; 0 25 25
77 25 ▶ if (!SvIOK(inner)) return 0;
Branch: 1 branch
BranchTrueFalseTotal
if (!SvIOK(inner)) return 0; 0 25 25
78 25 ▶ return (SvIVX(inner) == 0 || SvIVX(inner) == 1);
Branch: 2 branches
BranchTrueFalseTotal
return (SvIVX(inner) == 0 || SvIVX(inner) == 1); 14 11 25
return (SvIVX(inner) == 0 || SvIVX(inner) == 1); 14 0 14
79 }
80  
81 /* A ref protobuf cannot represent structurally: code, glob, regexp. Its
82 * stringification is used instead. Deliberately the same list File::Raw::JSON
83 * refuses, so both encoders make the same substitution. */
84 33 static int otel_ref_is_opaque(pTHX_ SV *v, SV *rv) {
85 #ifdef SvRXOK
86 33 ▶ if (SvRXOK(v) || SvRXOK(rv)) return 1;
Branch: 2 branches
BranchTrueFalseTotal
if (SvRXOK(v) || SvRXOK(rv)) return 1; 33 0 33
if (SvRXOK(v) || SvRXOK(rv)) return 1; 0 33 33
87 #endif
88 33 ▶ return SvTYPE(rv) == SVt_PVCV || SvTYPE(rv) == SVt_PVGV;
Branch: 2 branches
BranchTrueFalseTotal
return SvTYPE(rv) == SVt_PVCV || SvTYPE(rv) == SVt_PVGV; 28 5 33
return SvTYPE(rv) == SVt_PVCV || SvTYPE(rv) == SVt_PVGV; 0 28 28
89 }
90  
91 /* The rules at the top of this file, as one decision. */
92 95 static int otel_value_kind(pTHX_ SV *v) {
93 95 ▶ if (!v || !SvOK(v)) return OTV_NULL; /* rule 1 */
Branch: 2 branches
BranchTrueFalseTotal
if (!v || !SvOK(v)) return OTV_NULL; /* rule 1 */ 95 0 95
if (!v || !SvOK(v)) return OTV_NULL; /* rule 1 */ 7 88 95
94 88 ▶ if (SvROK(v)) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(v)) { 33 55 88
95 33 SV *rv = SvRV(v);
96 33 ▶ if (otel_is_bool(aTHX_ v)) return OTV_BOOL; /* rule 2 */
Branch: 1 branch
BranchTrueFalseTotal
if (otel_is_bool(aTHX_ v)) return OTV_BOOL; /* rule 2 */ 15 18 33
97 18 ▶ if (SvOBJECT(rv)) return OTV_STRING; /* rule 3: an object is
Branch: 1 branch
BranchTrueFalseTotal
if (SvOBJECT(rv)) return OTV_STRING; /* rule 3: an object is 1 17 18
98 * a value, not a shape */
99 17 ▶ if (otel_ref_is_opaque(aTHX_ v, rv)) return OTV_STRING; /* rule 6 */
Branch: 1 branch
BranchTrueFalseTotal
if (otel_ref_is_opaque(aTHX_ v, rv)) return OTV_STRING; /* rule 6 */ 1 16 17
100 16 ▶ if (SvTYPE(rv) == SVt_PVAV) return OTV_ARRAY; /* rule 4 */
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVAV) return OTV_ARRAY; /* rule 4 */ 8 8 16
101 8 ▶ if (SvTYPE(rv) == SVt_PVHV) return OTV_KVLIST; /* rule 5 */
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVHV) return OTV_KVLIST; /* rule 5 */ 8 0 8
102 0 return OTV_STRING;
103 }
104 55 ▶ if (SvIOK(v) && !SvPOK(v)) return OTV_INT; /* rule 7 */
Branch: 2 branches
BranchTrueFalseTotal
if (SvIOK(v) && !SvPOK(v)) return OTV_INT; /* rule 7 */ 18 37 55
if (SvIOK(v) && !SvPOK(v)) return OTV_INT; /* rule 7 */ 17 1 18
105 38 ▶ if (SvNOK(v) && !SvPOK(v)) return OTV_DOUBLE; /* rule 8 */
Branch: 2 branches
BranchTrueFalseTotal
if (SvNOK(v) && !SvPOK(v)) return OTV_DOUBLE; /* rule 8 */ 8 30 38
if (SvNOK(v) && !SvPOK(v)) return OTV_DOUBLE; /* rule 8 */ 8 0 8
106 30 return OTV_STRING; /* rule 9 */
107 }
108  
109 /* ---- the body of an AnyValue (no tag, no length) ------------------------ */
110  
111 657 static size_t otel_anyvalue_body_size(pTHX_ SV *v) {
112 657 ▶ if (!v || !SvOK(v)) return 0; /* rule 1: nothing set */
Branch: 2 branches
BranchTrueFalseTotal
if (!v || !SvOK(v)) return 0; /* rule 1: nothing set */ 657 0 657
if (!v || !SvOK(v)) return 0; /* rule 1: nothing set */ 2 655 657
113  
114 655 ▶ if (SvROK(v)) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(v)) { 16 639 655
115 16 SV *rv = SvRV(v);
116 16 ▶ if (otel_is_bool(aTHX_ v)) /* rule 2 */
Branch: 1 branch
BranchTrueFalseTotal
if (otel_is_bool(aTHX_ v)) /* rule 2 */ 5 11 16
117 5 return otel_pb_bool_size(PB_ANYVALUE_BOOL);
118 11 ▶ if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) {
Branch: 2 branches
BranchTrueFalseTotal
if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) { 8 3 11
if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) { 6 2 8
119 6 ▶ if (SvTYPE(rv) == SVt_PVAV) { /* rule 3 */
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVAV) { /* rule 3 */ 3 3 6
120 3 AV *av = (AV *)rv;
121 3 SSize_t i, n = av_len(av) + 1;
122 3 size_t inner = 0;
123 8 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 5 3 8
124 5 SV **e = av_fetch(av, i, 0);
125 5 ▶ inner += otel_pb_msg_size(PB_ARRAYVALUE_VALUES,
Branch: 1 branch
BranchTrueFalseTotal
inner += otel_pb_msg_size(PB_ARRAYVALUE_VALUES, 5 0 5
126 otel_anyvalue_body_size(aTHX_ (e ? *e : NULL)));
127 }
128 3 return otel_pb_msg_size(PB_ANYVALUE_ARRAY, inner);
129 }
130 3 ▶ if (SvTYPE(rv) == SVt_PVHV) { /* rule 4 */
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVHV) { /* rule 4 */ 3 0 3
131 3 HV *hv = (HV *)rv;
132 HE *he;
133 3 size_t inner = 0;
134 3 hv_iterinit(hv);
135 6 ▶ while ((he = hv_iternext(hv))) {
Branch: 1 branch
BranchTrueFalseTotal
while ((he = hv_iternext(hv))) { 3 3 6
136 STRLEN kl;
137 3 ▶ const char *k = HePV(he, kl);
Branch: 1 branch
BranchTrueFalseTotal
const char *k = HePV(he, kl); 0 3 3
138 3 size_t kv = otel_pb_bytes_size(PB_KEYVALUE_KEY, kl)
139 3 + otel_pb_msg_size(PB_KEYVALUE_VALUE,
140 otel_anyvalue_body_size(aTHX_ HeVAL(he)));
141 3 inner += otel_pb_msg_size(PB_KVLIST_VALUES, kv);
142 }
143 3 return otel_pb_msg_size(PB_ANYVALUE_KVLIST, inner);
144 }
145 }
146 { /* rule 5 */
147 STRLEN l; (void)SvPV_const(v, l);
148 5 return otel_pb_bytes_size(PB_ANYVALUE_STRING, l);
149 }
150 }
151  
152 639 ▶ if (SvIOK(v) && !SvPOK(v)) /* rule 6 */
Branch: 2 branches
BranchTrueFalseTotal
if (SvIOK(v) && !SvPOK(v)) /* rule 6 */ 112 527 639
if (SvIOK(v) && !SvPOK(v)) /* rule 6 */ 110 2 112
153 110 return otel_pb_uint64_size(PB_ANYVALUE_INT, (UV)SvIVX(v));
154 529 ▶ if (SvNOK(v) && !SvPOK(v)) /* rule 7 */
Branch: 2 branches
BranchTrueFalseTotal
if (SvNOK(v) && !SvPOK(v)) /* rule 7 */ 2 527 529
if (SvNOK(v) && !SvPOK(v)) /* rule 7 */ 2 0 2
155 2 return otel_pb_double_size(PB_ANYVALUE_DOUBLE);
156 { /* rule 8 */
157 STRLEN l; (void)SvPV_const(v, l);
158 527 return otel_pb_bytes_size(PB_ANYVALUE_STRING, l);
159 }
160 }
161  
162 147 static void otel_anyvalue_body_write(pTHX_ otel_buf *b, SV *v) {
163 147 ▶ if (!v || !SvOK(v)) return;
Branch: 2 branches
BranchTrueFalseTotal
if (!v || !SvOK(v)) return; 147 0 147
if (!v || !SvOK(v)) return; 2 145 147
164  
165 145 ▶ if (SvROK(v)) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvROK(v)) { 16 129 145
166 16 SV *rv = SvRV(v);
167 16 ▶ if (otel_is_bool(aTHX_ v)) {
Branch: 1 branch
BranchTrueFalseTotal
if (otel_is_bool(aTHX_ v)) { 5 11 16
168 5 otel_pb_bool(b, PB_ANYVALUE_BOOL, SvIVX(SvRV(v)) ? 1 : 0);
169 5 return;
170 }
171 11 ▶ if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) {
Branch: 2 branches
BranchTrueFalseTotal
if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) { 8 3 11
if (!SvOBJECT(rv) && !otel_ref_is_opaque(aTHX_ v, rv)) { 6 2 8
172 6 ▶ if (SvTYPE(rv) == SVt_PVAV) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVAV) { 3 3 6
173 3 AV *av = (AV *)rv;
174 3 SSize_t i, n = av_len(av) + 1;
175 3 size_t inner = 0, mark;
176 8 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 5 3 8
177 5 SV **e = av_fetch(av, i, 0);
178 5 ▶ inner += otel_pb_msg_size(PB_ARRAYVALUE_VALUES,
Branch: 1 branch
BranchTrueFalseTotal
inner += otel_pb_msg_size(PB_ARRAYVALUE_VALUES, 5 0 5
179 otel_anyvalue_body_size(aTHX_ (e ? *e : NULL)));
180 }
181 3 otel_pb_msg_head(b, PB_ANYVALUE_ARRAY, inner);
182 3 mark = b->len;
183 8 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 5 3 8
184 5 SV **e = av_fetch(av, i, 0);
185 5 ▶ SV *ev = e ? *e : NULL;
Branch: 1 branch
BranchTrueFalseTotal
SV *ev = e ? *e : NULL; 5 0 5
186 5 otel_pb_msg_head(b, PB_ARRAYVALUE_VALUES,
187 otel_anyvalue_body_size(aTHX_ ev));
188 5 otel_anyvalue_body_write(aTHX_ b, ev);
189 }
190 OTEL_PB_CHECK(b, mark, inner, "ArrayValue");
191 3 return;
192 }
193 3 ▶ if (SvTYPE(rv) == SVt_PVHV) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(rv) == SVt_PVHV) { 3 0 3
194 3 HV *hv = (HV *)rv;
195 HE *he;
196 3 size_t inner = 0, mark;
197 3 hv_iterinit(hv);
198 6 ▶ while ((he = hv_iternext(hv))) {
Branch: 1 branch
BranchTrueFalseTotal
while ((he = hv_iternext(hv))) { 3 3 6
199 STRLEN kl;
200 3 ▶ const char *k = HePV(he, kl);
Branch: 1 branch
BranchTrueFalseTotal
const char *k = HePV(he, kl); 0 3 3
201 3 inner += otel_pb_msg_size(PB_KVLIST_VALUES,
202 3 otel_pb_bytes_size(PB_KEYVALUE_KEY, kl)
203 3 + otel_pb_msg_size(PB_KEYVALUE_VALUE,
204 otel_anyvalue_body_size(aTHX_ HeVAL(he))));
205 }
206 3 otel_pb_msg_head(b, PB_ANYVALUE_KVLIST, inner);
207 3 mark = b->len;
208 3 hv_iterinit(hv);
209 6 ▶ while ((he = hv_iternext(hv))) {
Branch: 1 branch
BranchTrueFalseTotal
while ((he = hv_iternext(hv))) { 3 3 6
210 STRLEN kl;
211 3 ▶ const char *k = HePV(he, kl);
Branch: 1 branch
BranchTrueFalseTotal
const char *k = HePV(he, kl); 0 3 3
212 3 SV *val = HeVAL(he);
213 3 size_t vsz = otel_anyvalue_body_size(aTHX_ val);
214 3 otel_pb_msg_head(b, PB_KVLIST_VALUES,
215 3 otel_pb_bytes_size(PB_KEYVALUE_KEY, kl)
216 3 + otel_pb_msg_size(PB_KEYVALUE_VALUE, vsz));
217 3 otel_pb_bytes(b, PB_KEYVALUE_KEY, k, kl);
218 3 otel_pb_msg_head(b, PB_KEYVALUE_VALUE, vsz);
219 3 otel_anyvalue_body_write(aTHX_ b, val);
220 }
221 OTEL_PB_CHECK(b, mark, inner, "KeyValueList");
222 3 return;
223 }
224 }
225 {
226 STRLEN l;
227 5 const char *s = SvPV_const(v, l);
228 5 otel_pb_bytes(b, PB_ANYVALUE_STRING, s, l);
229 5 return;
230 }
231 }
232  
233 129 ▶ if (SvIOK(v) && !SvPOK(v)) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvIOK(v) && !SvPOK(v)) { 26 103 129
if (SvIOK(v) && !SvPOK(v)) { 24 2 26
234 24 otel_pb_uint64(b, PB_ANYVALUE_INT, (UV)SvIVX(v));
235 24 return;
236 }
237 105 ▶ if (SvNOK(v) && !SvPOK(v)) {
Branch: 2 branches
BranchTrueFalseTotal
if (SvNOK(v) && !SvPOK(v)) { 2 103 105
if (SvNOK(v) && !SvPOK(v)) { 2 0 2
238 2 otel_pb_double(b, PB_ANYVALUE_DOUBLE, SvNVX(v));
239 2 return;
240 }
241 {
242 STRLEN l;
243 103 const char *s = SvPV_const(v, l);
244 103 otel_pb_bytes(b, PB_ANYVALUE_STRING, s, l);
245 }
246 }
247  
248 /* ---- KeyValue lists ----------------------------------------------------- *
249 * Attributes arrive as a Perl hashref. Keys are SORTED, for the same reason
250 * the logger sorts its logfmt pairs: perl's hash order is randomised per
251 * process, and a payload whose bytes differ run to run cannot be compared
252 * against a golden vector, diffed, or cached. */
253  
254 466 static size_t otel_kv_size(pTHX_ const char *k, STRLEN kl, SV *v) {
255 466 return otel_pb_bytes_size(PB_KEYVALUE_KEY, kl)
256 466 + otel_pb_msg_size(PB_KEYVALUE_VALUE,
257 otel_anyvalue_body_size(aTHX_ v));
258 }
259  
260 104 static void otel_kv_write(pTHX_ otel_buf *b, const char *k, STRLEN kl, SV *v) {
261 104 size_t vsz = otel_anyvalue_body_size(aTHX_ v);
262 104 otel_pb_bytes(b, PB_KEYVALUE_KEY, k, kl);
263 104 otel_pb_msg_head(b, PB_KEYVALUE_VALUE, vsz);
264 104 otel_anyvalue_body_write(aTHX_ b, v);
265 104 }
266  
267 /* The sorted key list of an attribute hash, as a mortal AV. */
268 5750 static AV *otel_attr_keys(pTHX_ HV *hv) {
269 5750 AV *keys = (AV *)sv_2mortal((SV *)newAV());
270 HE *he;
271 5750 SSize_t n = 0;
272 5750 ▶ if (!hv) return keys;
Branch: 1 branch
BranchTrueFalseTotal
if (!hv) return keys; 228 5522 5750
273 5522 hv_iterinit(hv);
274 11296 ▶ while ((he = hv_iternext(hv))) { av_push(keys, newSVsv(hv_iterkeysv(he))); n++; }
Branch: 1 branch
BranchTrueFalseTotal
while ((he = hv_iternext(hv))) { av_push(keys, newSVsv(hv_iterkeysv(he))); n++; } 5774 5522 11296
275 5522 ▶ if (n > 1) sortsv(AvARRAY(keys), (STRLEN)n, Perl_sv_cmp);
Branch: 1 branch
BranchTrueFalseTotal
if (n > 1) sortsv(AvARRAY(keys), (STRLEN)n, Perl_sv_cmp); 78 5444 5522
276 5522 return keys;
277 }
278  
279 /* sum of `field`-tagged KeyValue messages for every pair in hv */
280 407 static size_t otel_attrs_size(pTHX_ HV *hv, int field) {
281 407 AV *keys = otel_attr_keys(aTHX_ hv);
282 407 SSize_t i, n = av_len(keys) + 1;
283 407 size_t total = 0;
284 769 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 362 407 769
285 362 SV **kp = av_fetch(keys, i, 0);
286 HE *e;
287 STRLEN kl;
288 const char *k;
289 362 ▶ if (!(kp && *kp)) continue;
Branch: 2 branches
BranchTrueFalseTotal
if (!(kp && *kp)) continue; 362 0 362
if (!(kp && *kp)) continue; 0 362 362
290 362 k = SvPV_const(*kp, kl);
291 362 e = hv_fetch_ent(hv, *kp, 0, 0);
292 362 ▶ total += otel_pb_msg_size(field,
Branch: 1 branch
BranchTrueFalseTotal
total += otel_pb_msg_size(field, 362 0 362
293 otel_kv_size(aTHX_ k, kl, e ? HeVAL(e) : NULL));
294 }
295 407 return total;
296 }
297  
298 97 static void otel_attrs_write(pTHX_ otel_buf *b, HV *hv, int field) {
299 97 AV *keys = otel_attr_keys(aTHX_ hv);
300 97 SSize_t i, n = av_len(keys) + 1;
301 201 ▶ for (i = 0; i < n; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < n; i++) { 104 97 201
302 104 SV **kp = av_fetch(keys, i, 0);
303 HE *e;
304 STRLEN kl;
305 const char *k;
306 SV *v;
307 104 ▶ if (!(kp && *kp)) continue;
Branch: 2 branches
BranchTrueFalseTotal
if (!(kp && *kp)) continue; 104 0 104
if (!(kp && *kp)) continue; 0 104 104
308 104 k = SvPV_const(*kp, kl);
309 104 e = hv_fetch_ent(hv, *kp, 0, 0);
310 104 ▶ v = e ? HeVAL(e) : NULL;
Branch: 1 branch
BranchTrueFalseTotal
v = e ? HeVAL(e) : NULL; 104 0 104
311 104 otel_pb_msg_head(b, field, otel_kv_size(aTHX_ k, kl, v));
312 104 otel_kv_write(aTHX_ b, k, kl, v);
313 }
314 97 }
315  
316 #endif /* OTEL_VALUE_H */
« include/otel_semconv.h ↑ Summary include/otel_tracer.h »