Skip to content

Commit 2c87949

Browse files
committed
extract extended opentelemetry only
1 parent 3336a0a commit 2c87949

File tree

51 files changed

+134
-2398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+134
-2398
lines changed

api/incubator/src/main/java/io/opentelemetry/api/incubator/ExtendedOpenTelemetry.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
package io.opentelemetry.api.incubator;
77

88
import io.opentelemetry.api.OpenTelemetry;
9-
import io.opentelemetry.api.incubator.entities.EntityProvider;
9+
import io.opentelemetry.api.incubator.config.ConfigProvider;
1010

11-
/** Extension to {@link OpenTelemetry} that adds {@link EntityProvider}. */
11+
/** Extension to {@link OpenTelemetry} that supports getting {@link ConfigProvider}. */
1212
public interface ExtendedOpenTelemetry extends OpenTelemetry {
13-
/** Returns the {@link EntityProvider} for this {@link OpenTelemetry}. */
14-
default EntityProvider getEntityProvider() {
15-
return EntityProvider.noop();
13+
/** Returns the {@link ConfigProvider} for this {@link OpenTelemetry}. */
14+
default ConfigProvider getConfigProvider() {
15+
return ConfigProvider.noop();
1616
}
1717
}

api/incubator/src/main/java/io/opentelemetry/api/incubator/entities/EntityBuilder.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

api/incubator/src/main/java/io/opentelemetry/api/incubator/entities/EntityProvider.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

api/incubator/src/main/java/io/opentelemetry/api/incubator/entities/NoopEntityBuilder.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

api/incubator/src/main/java/io/opentelemetry/api/incubator/entities/NoopEntityProvider.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/EntityRefMarshaler.java

Lines changed: 0 additions & 83 deletions
This file was deleted.

exporters/otlp/common/src/main/java/io/opentelemetry/exporter/internal/otlp/ResourceMarshaler.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.opentelemetry.exporter.internal.marshal.MarshalerWithSize;
1111
import io.opentelemetry.exporter.internal.marshal.Serializer;
1212
import io.opentelemetry.proto.resource.v1.internal.Resource;
13-
import io.opentelemetry.sdk.resources.internal.EntityUtil;
1413
import java.io.ByteArrayOutputStream;
1514
import java.io.IOException;
1615
import java.io.UncheckedIOException;
@@ -38,10 +37,7 @@ public static ResourceMarshaler create(io.opentelemetry.sdk.resources.Resource r
3837

3938
RealResourceMarshaler realMarshaler =
4039
new RealResourceMarshaler(
41-
KeyValueMarshaler.createForAttributes(resource.getAttributes()),
42-
EntityUtil.getEntities(resource).stream()
43-
.map(EntityRefMarshaler::createForEntity)
44-
.toArray(MarshalerWithSize[]::new));
40+
KeyValueMarshaler.createForAttributes(resource.getAttributes()));
4541

4642
ByteArrayOutputStream binaryBos =
4743
new ByteArrayOutputStream(realMarshaler.getBinarySerializedSize());
@@ -74,26 +70,19 @@ public void writeTo(Serializer output) throws IOException {
7470

7571
private static final class RealResourceMarshaler extends MarshalerWithSize {
7672
private final KeyValueMarshaler[] attributes;
77-
private final MarshalerWithSize[] entityRefs;
7873

79-
private RealResourceMarshaler(KeyValueMarshaler[] attributes, MarshalerWithSize[] entityRefs) {
80-
super(calculateSize(attributes, entityRefs));
74+
private RealResourceMarshaler(KeyValueMarshaler[] attributes) {
75+
super(calculateSize(attributes));
8176
this.attributes = attributes;
82-
this.entityRefs = entityRefs;
8377
}
8478

8579
@Override
8680
protected void writeTo(Serializer output) throws IOException {
8781
output.serializeRepeatedMessage(Resource.ATTRIBUTES, attributes);
88-
output.serializeRepeatedMessage(Resource.ENTITY_REFS, entityRefs);
8982
}
9083

91-
private static int calculateSize(
92-
KeyValueMarshaler[] attributeMarshalers, MarshalerWithSize[] entityRefs) {
93-
int size = 0;
94-
size += MarshalerUtil.sizeRepeatedMessage(Resource.ATTRIBUTES, attributeMarshalers);
95-
size += size += MarshalerUtil.sizeRepeatedMessage(Resource.ENTITY_REFS, entityRefs);
96-
return size;
84+
private static int calculateSize(KeyValueMarshaler[] attributeMarshalers) {
85+
return MarshalerUtil.sizeRepeatedMessage(Resource.ATTRIBUTES, attributeMarshalers);
9786
}
9887
}
9988
}

exporters/otlp/common/src/test/java/io/opentelemetry/exporter/internal/otlp/EntityRefMarshalerTest.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)