Skip to content

Commit ae25ae3

Browse files
authored
fix(api-logs): align AnyValue to spec (#4893)
1 parent cf8edbe commit ae25ae3

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

experimental/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ All notable changes to experimental packages in this project will be documented
2525
### :bug: (Bug Fix)
2626

2727
* 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
28+
* fix(api-logs): align AnyValue to spec [#4893](https://github.com/open-telemetry/opentelemetry-js/pull/4893) @blumamir
2829

2930
### :books: (Refine Doc)
3031

experimental/packages/api-logs/src/types/AnyValue.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,29 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { AttributeValue } from '@opentelemetry/api';
17+
export type AnyValueScalar = string | number | boolean;
18+
19+
export type AnyValueArray = Array<AnyValue>;
1820

1921
/**
2022
* AnyValueMap is a map from string to AnyValue (attribute value or a nested map)
2123
*/
2224
export interface AnyValueMap {
23-
[attributeKey: string]: AnyValue | undefined;
25+
[attributeKey: string]: AnyValue;
2426
}
2527

2628
/**
27-
* AnyValue is a either an attribute value or a map of AnyValue(s)
29+
* AnyValue can be one of the following:
30+
* - a scalar value
31+
* - a byte array
32+
* - array of any value
33+
* - map from string to any value
34+
* - empty value
2835
*/
29-
export type AnyValue = AttributeValue | AnyValueMap;
36+
export type AnyValue =
37+
| AnyValueScalar
38+
| Uint8Array
39+
| AnyValueArray
40+
| AnyValueMap
41+
| null
42+
| undefined;

0 commit comments

Comments
 (0)