Skip to content

Commit

Permalink
Allow array values for attributes
Browse files Browse the repository at this point in the history
Resolves #341

Array values are useful for representing attributes that can have
multiple values (e.g. representing a Memcached `get` that can be
over multiple keys and making the keys a span attribute).

This change allows homogeneous array values for span attributes
and specifies that array values should be JSON encoded stirng when
exporting using protocols that do not natively support array values.
  • Loading branch information
Tigran Najaryan committed Dec 2, 2019
1 parent e6cd52d commit 51baa9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions specification/api-tracing.md
Expand Up @@ -344,8 +344,10 @@ A `Span` MUST have the ability to set attributes associated with it.
An `Attribute` is defined by the following properties:

- (Required) The attribute key, which must be a string.
- (Required) The attribute value, which must be either a string, a boolean
value, or a numeric type.
- (Required) The attribute value, which is either:
- A primitive type: string, boolean or numeric.
- An array of primitive type values. The array MUST be homogeneous,
i.e. it MUST NOT contain values of different types.

The Span interface MUST provide:

Expand Down
5 changes: 5 additions & 0 deletions specification/data-semantic-conventions.md
Expand Up @@ -6,6 +6,11 @@ Span attributes.
* [Resource Conventions](data-resource-semantic-conventions.md)
* [Span Conventions](#span-conventions)

The type of the attribute SHOULD be specified in the semantic convention
for that attribute. Array values are allowed for attributes. For
protocols that do not natively support array values such values MUST be
represented as JSON strings.

## Span Conventions

In OpenTelemetry spans can be created freely and it’s up to the implementor to
Expand Down

0 comments on commit 51baa9a

Please sign in to comment.