Skip to content

Commit 3d8da71

Browse files
committed
POC: Complex attributes (Option A)
1 parent 9868c85 commit 3d8da71

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

api/all/src/main/java/io/opentelemetry/api/common/AttributeKey.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,16 @@ static AttributeKey<List<Long>> longArrayKey(String key) {
7070
static AttributeKey<List<Double>> doubleArrayKey(String key) {
7171
return InternalAttributeKeyImpl.create(key, AttributeType.DOUBLE_ARRAY);
7272
}
73+
74+
static AttributeKey<byte[]> byteArrayKey(String key) {
75+
return InternalAttributeKeyImpl.create(key, AttributeType.BYTE_ARRAY);
76+
}
77+
78+
static AttributeKey<List<Value<?>>> valueArrayKey(String key) {
79+
return InternalAttributeKeyImpl.create(key, AttributeType.VALUE_ARRAY);
80+
}
81+
82+
static AttributeKey<Attributes> mapKey(String key) {
83+
return InternalAttributeKeyImpl.create(key, AttributeType.MAP);
84+
}
7385
}

api/all/src/main/java/io/opentelemetry/api/common/AttributeType.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ public enum AttributeType {
1717
STRING_ARRAY,
1818
BOOLEAN_ARRAY,
1919
LONG_ARRAY,
20-
DOUBLE_ARRAY
20+
DOUBLE_ARRAY,
21+
BYTE_ARRAY,
22+
VALUE_ARRAY,
23+
MAP
2124
}

api/all/src/main/java/io/opentelemetry/api/common/Value.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ static Value<List<KeyValue>> of(Map<String, Value<?>> value) {
8484
return KeyValueList.createFromMap(value);
8585
}
8686

87+
static Value<List<KeyValue>> of(Attributes attributes) {
88+
// TODO
89+
}
90+
8791
/** Returns the type of this {@link Value}. Useful for building switch statements. */
8892
ValueType getType();
8993

0 commit comments

Comments
 (0)