Skip to content

Commit 66bcc92

Browse files
committed
Add Marshalers for profiling signal type
Changes addressing review comments
1 parent 04e4140 commit 66bcc92

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,26 @@
1111
import io.opentelemetry.exporter.internal.otlp.InstrumentationScopeMarshaler;
1212
import io.opentelemetry.proto.profiles.v1experimental.internal.ScopeProfiles;
1313
import java.io.IOException;
14+
import java.util.List;
1415

1516
final class InstrumentationScopeProfilesMarshaler extends MarshalerWithSize {
1617

1718
private final InstrumentationScopeMarshaler instrumentationScope;
18-
private final ProfileContainerMarshaler[] profileContainerMarshalers;
19+
private final List<ProfileContainerMarshaler> profileContainerMarshalers;
1920
private final byte[] schemaUrlUtf8;
2021

2122
InstrumentationScopeProfilesMarshaler(
2223
InstrumentationScopeMarshaler instrumentationScope,
2324
byte[] schemaUrlUtf8,
24-
ProfileContainerMarshaler[] profileContainerMarshalers) {
25+
List<ProfileContainerMarshaler> profileContainerMarshalers) {
2526
super(calculateSize(instrumentationScope, schemaUrlUtf8, profileContainerMarshalers));
2627
this.instrumentationScope = instrumentationScope;
2728
this.schemaUrlUtf8 = schemaUrlUtf8;
2829
this.profileContainerMarshalers = profileContainerMarshalers;
2930
}
3031

3132
@Override
32-
protected void writeTo(Serializer output) throws IOException {
33+
public void writeTo(Serializer output) throws IOException {
3334
output.serializeMessage(ScopeProfiles.SCOPE, instrumentationScope);
3435
output.serializeRepeatedMessage(ScopeProfiles.PROFILES, profileContainerMarshalers);
3536
output.serializeString(ScopeProfiles.SCHEMA_URL, schemaUrlUtf8);
@@ -38,7 +39,7 @@ protected void writeTo(Serializer output) throws IOException {
3839
private static int calculateSize(
3940
InstrumentationScopeMarshaler instrumentationScope,
4041
byte[] schemaUrlUtf8,
41-
ProfileContainerMarshaler[] profileContainerMarshalers) {
42+
List<ProfileContainerMarshaler> profileContainerMarshalers) {
4243
int size = 0;
4344
size += MarshalerUtil.sizeMessage(ScopeProfiles.SCOPE, instrumentationScope);
4445
size += MarshalerUtil.sizeRepeatedMessage(ScopeProfiles.PROFILES, profileContainerMarshalers);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
public final class ProfilesRequestMarshaler extends MarshalerWithSize {
2525

26-
public static final ProtoFieldInfo RESOURCE_PROFILES =
26+
private static final ProtoFieldInfo RESOURCE_PROFILES =
2727
ExportProfilesServiceRequest.RESOURCE_PROFILES;
2828

2929
private final ResourceProfilesMarshaler[] resourceProfilesMarshalers;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static ResourceProfilesMarshaler[] create(Collection<ProfileContainerData> profi
4545
new InstrumentationScopeProfilesMarshaler(
4646
InstrumentationScopeMarshaler.create(entryIs.getKey()),
4747
MarshalerUtil.toBytes(entryIs.getKey().getSchemaUrl()),
48-
entryIs.getValue().toArray(new ProfileContainerMarshaler[0]));
48+
entryIs.getValue());
4949
}
5050

5151
resourceProfilesMarshalers[posResource++] =

0 commit comments

Comments
 (0)