Skip to content

Commit

Permalink
fix(api-logs): align AnyValue to spec (open-telemetry#4893)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir authored and Zirak committed Sep 14, 2024
1 parent 6573204 commit 0aa3da9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All notable changes to experimental packages in this project will be documented
### :bug: (Bug Fix)

* fix(instrumentation-http): Ensure instrumentation of `http.get` and `https.get` work when used in ESM code [#4857](https://github.com/open-telemetry/opentelemetry-js/issues/4857) @trentm
* fix(api-logs): align AnyValue to spec [#4893](https://github.com/open-telemetry/opentelemetry-js/pull/4893) @blumamir

### :books: (Refine Doc)

Expand Down
21 changes: 17 additions & 4 deletions experimental/packages/api-logs/src/types/AnyValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,29 @@
* limitations under the License.
*/

import { AttributeValue } from '@opentelemetry/api';
export type AnyValueScalar = string | number | boolean;

export type AnyValueArray = Array<AnyValue>;

/**
* AnyValueMap is a map from string to AnyValue (attribute value or a nested map)
*/
export interface AnyValueMap {
[attributeKey: string]: AnyValue | undefined;
[attributeKey: string]: AnyValue;
}

/**
* AnyValue is a either an attribute value or a map of AnyValue(s)
* AnyValue can be one of the following:
* - a scalar value
* - a byte array
* - array of any value
* - map from string to any value
* - empty value
*/
export type AnyValue = AttributeValue | AnyValueMap;
export type AnyValue =
| AnyValueScalar
| Uint8Array
| AnyValueArray
| AnyValueMap
| null
| undefined;

0 comments on commit 0aa3da9

Please sign in to comment.