Skip to content

Commit

Permalink
chore: disallow null attribute values (open-telemetry#1555)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Feb 18, 2021
1 parent 4a4fea0 commit f9a2ce0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions api/src/trace/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
*/

export interface Attributes {
[attributeKey: string]: AttributeValue;
[attributeKey: string]: AttributeValue | undefined;
}

export type AttributeValue =
| undefined
| null
| string
| number
| boolean
Expand Down
2 changes: 1 addition & 1 deletion api/src/trace/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface Span {
* @param key the key for this attribute.
* @param value the value for this attribute.
*/
setAttribute(key: string, value: AttributeValue): this;
setAttribute(key: string, value?: AttributeValue): this;

/**
* Sets attributes to the span.
Expand Down

0 comments on commit f9a2ce0

Please sign in to comment.