Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve profiles attribute table handling #7031

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package io.opentelemetry.exporter.otlp.internal.data;

import com.google.auto.value.AutoValue;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
import io.opentelemetry.exporter.otlp.profiles.AttributeUnitData;
import io.opentelemetry.exporter.otlp.profiles.FunctionData;
import io.opentelemetry.exporter.otlp.profiles.LinkData;
Expand Down Expand Up @@ -48,7 +48,7 @@ public static ProfileData create(
List<LocationData> locationTable,
List<Integer> locationIndices,
List<FunctionData> functionTable,
Attributes attributeTable,
List<AttributeKeyValue<?>> attributeTable,
List<AttributeUnitData> attributeUnits,
List<LinkData> linkTable,
List<String> stringTable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public interface LocationData {
boolean isFolded();

/** References to attributes in Profile.attribute_table. */
List<Integer> getAttributes();
List<Integer> getAttributeIndices();
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static LocationMarshaler create(LocationData locationData) {
locationData.getAddress(),
LineMarshaler.createRepeated(locationData.getLines()),
locationData.isFolded(),
locationData.getAttributes());
locationData.getAttributeIndices());
}

static LocationMarshaler[] createRepeated(List<LocationData> items) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package io.opentelemetry.exporter.otlp.profiles;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.internal.OtelEncodingUtils;
import io.opentelemetry.exporter.internal.otlp.AttributeKeyValue;
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
import io.opentelemetry.sdk.resources.Resource;
import java.nio.ByteBuffer;
Expand Down Expand Up @@ -51,7 +51,7 @@ public interface ProfileData {
List<FunctionData> getFunctionTable();

/** Lookup table for attributes. */
Attributes getAttributeTable();
List<AttributeKeyValue<?>> getAttributeTable();

/** Represents a mapping between Attribute Keys and Units. */
List<AttributeUnitData> getAttributeUnits();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static ProfileMarshaler create(ProfileData profileData) {
FunctionMarshaler[] functionMarshalers =
FunctionMarshaler.createRepeated(profileData.getFunctionTable());
KeyValueMarshaler[] attributeTableMarshalers =
KeyValueMarshaler.createForAttributes(profileData.getAttributeTable());
KeyValueMarshaler.createRepeated(profileData.getAttributeTable());
AttributeUnitMarshaler[] attributeUnitsMarshalers =
AttributeUnitMarshaler.createRepeated(profileData.getAttributeUnits());
LinkMarshaler[] linkMarshalers = LinkMarshaler.createRepeated(profileData.getLinkTable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void compareResourceProfilesMarshaling() {
Collections.emptyList(),
listOf(1, 2),
Collections.emptyList(),
Attributes.empty(),
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(),
Collections.emptyList(),
Expand Down
Loading