This repository was archived by the owner on Nov 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +44
-13
lines changed
Expand file tree Collapse file tree 3 files changed +44
-13
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright The OpenTelemetry Authors
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ /**
18+ * Attributes is a map from string to attribute values.
19+ */
20+ export interface Attributes {
21+ [ attributeKey : string ] : AttributeValue | undefined ;
22+ }
23+
24+ /**
25+ * Attribute values may be any non-nullish primitive value except an object.
26+ *
27+ * null or undefined attribute values are invalid and will result in undefined behavior.
28+ */
29+ export type AttributeValue =
30+ | string
31+ | number
32+ | boolean
33+ | Array < null | undefined | string >
34+ | Array < null | undefined | number >
35+ | Array < null | undefined | boolean > ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export * from './baggage/types';
1818export { baggageEntryMetadataFromString } from './baggage/utils' ;
1919export * from './common/Exception' ;
2020export * from './common/Time' ;
21+ export * from './common/Attributes' ;
2122export * from './diag' ;
2223export * from './propagation/TextMapPropagator' ;
2324export * from './trace/attributes' ;
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- export interface SpanAttributes {
18- [ attributeKey : string ] : SpanAttributeValue | undefined ;
19- }
17+ import { Attributes , AttributeValue } from '../common/Attributes' ;
2018
2119/**
22- * Attribute values may be any non-nullish primitive value except an object.
23- *
24- * null or undefined attribute values are invalid and will result in undefined behavior.
20+ * @deprecated please use Attributes
21+ */
22+ export type SpanAttributes = Attributes ;
23+
24+ /**
25+ * @deprecated please use AttributeValue
2526 */
26- export type SpanAttributeValue =
27- | string
28- | number
29- | boolean
30- | Array < null | undefined | string >
31- | Array < null | undefined | number >
32- | Array < null | undefined | boolean > ;
27+ export type SpanAttributeValue = AttributeValue ;
You can’t perform that action at this time.
0 commit comments