Skip to content

Commit 013d166

Browse files
authored
Improve profiles attribute table handling (#7031)
1 parent b4fec05 commit 013d166

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/internal/data/ImmutableProfileData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.exporter.otlp.internal.data;
77

88
import com.google.auto.value.AutoValue;
9-
import io.opentelemetry.api.common.Attributes;
9+
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
1010
import io.opentelemetry.exporter.otlp.profiles.AttributeUnitData;
1111
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
1212
import io.opentelemetry.exporter.otlp.profiles.LinkData;
@@ -48,7 +48,7 @@ public static ProfileData create(
4848
List<LocationData> locationTable,
4949
List<Integer> locationIndices,
5050
List<FunctionData> functionTable,
51-
Attributes attributeTable,
51+
List<AttributeKeyValue<?>> attributeTable,
5252
List<AttributeUnitData> attributeUnits,
5353
List<LinkData> linkTable,
5454
List<String> stringTable,

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public interface LocationData {
3838
boolean isFolded();
3939

4040
/** References to attributes in Profile.attribute_table. */
41-
List<Integer> getAttributes();
41+
List<Integer> getAttributeIndices();
4242
}

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/LocationMarshaler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static LocationMarshaler create(LocationData locationData) {
3030
locationData.getAddress(),
3131
LineMarshaler.createRepeated(locationData.getLines()),
3232
locationData.isFolded(),
33-
locationData.getAttributes());
33+
locationData.getAttributeIndices());
3434
}
3535

3636
static LocationMarshaler[] createRepeated(List<LocationData> items) {

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
package io.opentelemetry.exporter.otlp.profiles;
77

8-
import io.opentelemetry.api.common.Attributes;
98
import io.opentelemetry.api.internal.OtelEncodingUtils;
9+
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
1010
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
1111
import io.opentelemetry.sdk.resources.Resource;
1212
import java.nio.ByteBuffer;
@@ -51,7 +51,7 @@ public interface ProfileData {
5151
List<FunctionData> getFunctionTable();
5252

5353
/** Lookup table for attributes. */
54-
Attributes getAttributeTable();
54+
List<AttributeKeyValue<?>> getAttributeTable();
5555

5656
/** Represents a mapping between Attribute Keys and Units. */
5757
List<AttributeUnitData> getAttributeUnits();

exporters/otlp/profiles/src/main/java/io/opentelemetry/exporter/otlp/profiles/ProfileMarshaler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static ProfileMarshaler create(ProfileData profileData) {
5151
FunctionMarshaler[] functionMarshalers =
5252
FunctionMarshaler.createRepeated(profileData.getFunctionTable());
5353
KeyValueMarshaler[] attributeTableMarshalers =
54-
KeyValueMarshaler.createForAttributes(profileData.getAttributeTable());
54+
KeyValueMarshaler.createRepeated(profileData.getAttributeTable());
5555
AttributeUnitMarshaler[] attributeUnitsMarshalers =
5656
AttributeUnitMarshaler.createRepeated(profileData.getAttributeUnits());
5757
LinkMarshaler[] linkMarshalers = LinkMarshaler.createRepeated(profileData.getLinkTable());

exporters/otlp/profiles/src/test/java/io/opentelemetry/exporter/otlp/profiles/ProfilesRequestMarshalerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void compareResourceProfilesMarshaling() {
151151
Collections.emptyList(),
152152
listOf(1, 2),
153153
Collections.emptyList(),
154-
Attributes.empty(),
154+
Collections.emptyList(),
155155
Collections.emptyList(),
156156
Collections.emptyList(),
157157
Collections.emptyList(),

0 commit comments

Comments
 (0)