Skip to content

Commit 1248549

Browse files
dashpolejmacdbogdandrutu
authored
Describe how to convert non-string primitives for protocols which only support strings (open-telemetry#2343)
* Describe how to handle converting non-string primitives for protocols that only support strings * update wording to make clear that only non-string values are converted to strings * unify language * Update specification/common/common.md Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com> Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com> Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
1 parent 16e1193 commit 1248549

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

specification/common/common.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ An `Attribute` is a key-value pair, which MUST have the following properties:
2626
- The attribute value is either:
2727
- A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.
2828
- An array of primitive type values. The array MUST be homogeneous,
29-
i.e., it MUST NOT contain values of different types. For protocols that do
30-
not natively support array values such values SHOULD be represented as JSON strings.
29+
i.e., it MUST NOT contain values of different types.
30+
31+
For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON-encoded strings. For example, the expression `int64(100)` will be encoded as `100`, `float64(1.5)` will be encoded as `1.5`, and an empty array of any type will be encoded as `[]`.
3132

3233
Attribute values expressing a numerical value of zero, an empty string, or an
3334
empty array are considered meaningful and MUST be stored and passed on to

0 commit comments

Comments
 (0)