undefined - Excluding this means the common practice in instrumentations,
using undefined to mean "no value for this optional attribute", can
remain supported.
BigInt
TypedArrays other than Uint8Array
subclasses of Object, e.g. Date, Error
The TypeScript type unknown is used for AnyValue. This has some
implications:
Callers of @opentelemetry/api APIs using AnyValue can pass in
whatever type. This was always the case for (untyped) JavaScript usage.
SDK implementations of @opentelemetry/api need to document if/when they
support a subset of AnyValue types.
Using unknown allows future changes to support more types (e.g. BigInt).
AnyValue can be:
https://opentelemetry.io/docs/specs/otel/common/#anyvalue
Notable JavaScript types that are excluded:
undefined- Excluding this means the common practice in instrumentations, usingundefinedto mean "no value for this optional attribute", can remain supported.BigIntUint8ArrayThe TypeScript type
unknownis used forAnyValue. This has some implications:@opentelemetry/apiAPIs usingAnyValuecan pass in whatever type. This was always the case for (untyped) JavaScript usage.@opentelemetry/apineed to document if/when they support a subset of AnyValue types.unknownallows future changes to support more types (e.g. BigInt).