Skip to content

Commit 83ba41b

Browse files
committed
reflect schemas and subschemas changes
1 parent e016642 commit 83ba41b

File tree

11 files changed

+102
-91
lines changed

11 files changed

+102
-91
lines changed

sdk-extensions/incubator/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ dependencies {
6060
// it was needed after 0.3.0 release because file_format in the examples weren't updated prior to the release tag
6161
// val configurationTag = "0.3.0"
6262
// val configurationRef = "refs/tags/v$configurationTag" // Replace with commit SHA to point to experiment with a specific commit
63-
val configurationRef = "588a82d0c5d249c9ff807329fb0c887d17486b0f"
64-
val configurationRepoZip = "https://github.com/open-telemetry/opentelemetry-configuration/archive/$configurationRef.zip"
63+
val configurationRef = "44cf609538b0d55f29cbb55aee9cfce1e66804b8"
64+
val configurationRepoZip = "https://github.com/jack-berg/opentelemetry-configuration/archive/$configurationRef.zip"
6565
val buildDirectory = layout.buildDirectory.asFile.get()
6666

6767
val downloadConfigurationSchema by tasks.registering(Download::class) {

sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/AggregationFactory.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
99
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException;
1010
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.AggregationModel;
11-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Base2ExponentialBucketHistogramModel;
12-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ExplicitBucketHistogramModel;
11+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Base2ExponentialBucketHistogramAggregationModel;
12+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ExplicitBucketHistogramAggregationModel;
1313
import java.io.Closeable;
1414
import java.util.List;
1515

@@ -36,7 +36,7 @@ public io.opentelemetry.sdk.metrics.Aggregation create(
3636
if (model.getLastValue() != null) {
3737
return io.opentelemetry.sdk.metrics.Aggregation.lastValue();
3838
}
39-
Base2ExponentialBucketHistogramModel exponentialBucketHistogram =
39+
Base2ExponentialBucketHistogramAggregationModel exponentialBucketHistogram =
4040
model.getBase2ExponentialBucketHistogram();
4141
if (exponentialBucketHistogram != null) {
4242
Integer maxScale = exponentialBucketHistogram.getMaxScale();
@@ -54,7 +54,8 @@ public io.opentelemetry.sdk.metrics.Aggregation create(
5454
throw new ConfigurationException("Invalid exponential bucket histogram", e);
5555
}
5656
}
57-
ExplicitBucketHistogramModel explicitBucketHistogram = model.getExplicitBucketHistogram();
57+
ExplicitBucketHistogramAggregationModel explicitBucketHistogram =
58+
model.getExplicitBucketHistogram();
5859
if (explicitBucketHistogram != null) {
5960
List<Double> boundaries = explicitBucketHistogram.getBoundaries();
6061
if (boundaries == null) {

sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/AttributeListFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ private static void addToBuilder(
4343
AttributeNameValueModel nameValueModel, AttributesBuilder builder) {
4444
String name = FileConfigUtil.requireNonNull(nameValueModel.getName(), "attribute name");
4545
Object value = FileConfigUtil.requireNonNull(nameValueModel.getValue(), "attribute value");
46-
AttributeNameValueModel.Type type = nameValueModel.getType();
46+
AttributeNameValueModel.AttributeType type = nameValueModel.getType();
4747
if (type == null) {
48-
type = AttributeNameValueModel.Type.STRING;
48+
type = AttributeNameValueModel.AttributeType.STRING;
4949
}
5050
switch (type) {
5151
case STRING:

sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/SamplerFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
1111
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException;
12-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.JaegerRemoteModel;
13-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ParentBasedModel;
12+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.JaegerRemoteSamplerModel;
13+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ParentBasedSamplerModel;
1414
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.SamplerModel;
15-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.TraceIdRatioBasedModel;
15+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.TraceIdRatioBasedSamplerModel;
1616
import io.opentelemetry.sdk.trace.samplers.ParentBasedSamplerBuilder;
1717
import io.opentelemetry.sdk.trace.samplers.Sampler;
1818
import java.io.Closeable;
@@ -37,15 +37,15 @@ public Sampler create(SamplerModel model, SpiHelper spiHelper, List<Closeable> c
3737
if (model.getAlwaysOff() != null) {
3838
return Sampler.alwaysOff();
3939
}
40-
TraceIdRatioBasedModel traceIdRatioBasedModel = model.getTraceIdRatioBased();
40+
TraceIdRatioBasedSamplerModel traceIdRatioBasedModel = model.getTraceIdRatioBased();
4141
if (traceIdRatioBasedModel != null) {
4242
Double ratio = traceIdRatioBasedModel.getRatio();
4343
if (ratio == null) {
4444
ratio = 1.0d;
4545
}
4646
return Sampler.traceIdRatioBased(ratio);
4747
}
48-
ParentBasedModel parentBasedModel = model.getParentBased();
48+
ParentBasedSamplerModel parentBasedModel = model.getParentBased();
4949
if (parentBasedModel != null) {
5050
Sampler root =
5151
parentBasedModel.getRoot() == null
@@ -73,7 +73,7 @@ public Sampler create(SamplerModel model, SpiHelper spiHelper, List<Closeable> c
7373
return builder.build();
7474
}
7575

76-
JaegerRemoteModel jaegerRemoteModel = model.getJaegerRemote();
76+
JaegerRemoteSamplerModel jaegerRemoteModel = model.getJaegerRemote();
7777
if (jaegerRemoteModel != null) {
7878
model.getAdditionalProperties().put("jaeger_remote", jaegerRemoteModel);
7979
}

sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/AggregationFactoryTest.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
1212
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.AggregationModel;
13-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Base2ExponentialBucketHistogramModel;
14-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.DropModel;
15-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ExplicitBucketHistogramModel;
16-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.LastValueModel;
17-
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.SumModel;
13+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Base2ExponentialBucketHistogramAggregationModel;
14+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.DropAggregationModel;
15+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ExplicitBucketHistogramAggregationModel;
16+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.LastValueAggregationModel;
17+
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.SumAggregationModel;
1818
import java.util.ArrayList;
1919
import java.util.Arrays;
2020
import java.util.stream.Stream;
@@ -37,32 +37,36 @@ private static Stream<Arguments> createTestCases() {
3737
Arguments.of(
3838
new AggregationModel(), io.opentelemetry.sdk.metrics.Aggregation.defaultAggregation()),
3939
Arguments.of(
40-
new AggregationModel().withDrop(new DropModel()),
40+
new AggregationModel().withDrop(new DropAggregationModel()),
4141
io.opentelemetry.sdk.metrics.Aggregation.drop()),
4242
Arguments.of(
43-
new AggregationModel().withSum(new SumModel()),
43+
new AggregationModel().withSum(new SumAggregationModel()),
4444
io.opentelemetry.sdk.metrics.Aggregation.sum()),
4545
Arguments.of(
46-
new AggregationModel().withLastValue(new LastValueModel()),
46+
new AggregationModel().withLastValue(new LastValueAggregationModel()),
4747
io.opentelemetry.sdk.metrics.Aggregation.lastValue()),
4848
Arguments.of(
4949
new AggregationModel()
50-
.withBase2ExponentialBucketHistogram(new Base2ExponentialBucketHistogramModel()),
50+
.withBase2ExponentialBucketHistogram(
51+
new Base2ExponentialBucketHistogramAggregationModel()),
5152
io.opentelemetry.sdk.metrics.Aggregation.base2ExponentialBucketHistogram()),
5253
Arguments.of(
5354
new AggregationModel()
5455
.withBase2ExponentialBucketHistogram(
55-
new Base2ExponentialBucketHistogramModel().withMaxSize(2).withMaxScale(2)),
56+
new Base2ExponentialBucketHistogramAggregationModel()
57+
.withMaxSize(2)
58+
.withMaxScale(2)),
5659
io.opentelemetry.sdk.metrics.Aggregation.base2ExponentialBucketHistogram(2, 2)),
5760
Arguments.of(
5861
new AggregationModel()
5962
.withExplicitBucketHistogram(
60-
new ExplicitBucketHistogramModel().withBoundaries(null)),
63+
new ExplicitBucketHistogramAggregationModel().withBoundaries(null)),
6164
io.opentelemetry.sdk.metrics.Aggregation.explicitBucketHistogram()),
6265
Arguments.of(
6366
new AggregationModel()
6467
.withExplicitBucketHistogram(
65-
new ExplicitBucketHistogramModel().withBoundaries(Arrays.asList(1.0, 2.0))),
68+
new ExplicitBucketHistogramAggregationModel()
69+
.withBoundaries(Arrays.asList(1.0, 2.0))),
6670
io.opentelemetry.sdk.metrics.Aggregation.explicitBucketHistogram(
6771
Arrays.asList(1.0, 2.0))));
6872
}

sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/AttributeListFactoryTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ private static Stream<Arguments> invalidAttributes() {
4848
Collections.singletonList(
4949
new AttributeNameValueModel()
5050
.withName("key")
51-
.withType(AttributeNameValueModel.Type.INT)
51+
.withType(AttributeNameValueModel.AttributeType.INT)
5252
.withValue(Arrays.asList(1L, 1))),
5353
"Error processing attribute with name \"key\": value did not match type INT"),
5454
Arguments.of(
5555
Collections.singletonList(
5656
new AttributeNameValueModel()
5757
.withName("key")
58-
.withType(AttributeNameValueModel.Type.INT)
58+
.withType(AttributeNameValueModel.AttributeType.INT)
5959
.withValue(true)),
6060
"Error processing attribute with name \"key\": value did not match type INT"));
6161
}
@@ -88,51 +88,51 @@ void create() {
8888
new AttributeNameValueModel()
8989
.withName("strKey")
9090
.withValue("val")
91-
.withType(AttributeNameValueModel.Type.STRING),
91+
.withType(AttributeNameValueModel.AttributeType.STRING),
9292
new AttributeNameValueModel()
9393
.withName("longKey")
9494
.withValue(1L)
95-
.withType(AttributeNameValueModel.Type.INT),
95+
.withType(AttributeNameValueModel.AttributeType.INT),
9696
new AttributeNameValueModel()
9797
.withName("intKey")
9898
.withValue(2)
99-
.withType(AttributeNameValueModel.Type.INT),
99+
.withType(AttributeNameValueModel.AttributeType.INT),
100100
new AttributeNameValueModel()
101101
.withName("doubleKey")
102102
.withValue(1.0d)
103-
.withType(AttributeNameValueModel.Type.DOUBLE),
103+
.withType(AttributeNameValueModel.AttributeType.DOUBLE),
104104
new AttributeNameValueModel()
105105
.withName("floatKey")
106106
.withValue(2.0f)
107-
.withType(AttributeNameValueModel.Type.DOUBLE),
107+
.withType(AttributeNameValueModel.AttributeType.DOUBLE),
108108
new AttributeNameValueModel()
109109
.withName("boolKey")
110110
.withValue(true)
111-
.withType(AttributeNameValueModel.Type.BOOL),
111+
.withType(AttributeNameValueModel.AttributeType.BOOL),
112112
new AttributeNameValueModel()
113113
.withName("strArrKey")
114114
.withValue(Arrays.asList("val1", "val2"))
115-
.withType(AttributeNameValueModel.Type.STRING_ARRAY),
115+
.withType(AttributeNameValueModel.AttributeType.STRING_ARRAY),
116116
new AttributeNameValueModel()
117117
.withName("longArrKey")
118118
.withValue(Arrays.asList(1L, 2L))
119-
.withType(AttributeNameValueModel.Type.INT_ARRAY),
119+
.withType(AttributeNameValueModel.AttributeType.INT_ARRAY),
120120
new AttributeNameValueModel()
121121
.withName("intArrKey")
122122
.withValue(Arrays.asList(1, 2))
123-
.withType(AttributeNameValueModel.Type.INT_ARRAY),
123+
.withType(AttributeNameValueModel.AttributeType.INT_ARRAY),
124124
new AttributeNameValueModel()
125125
.withName("doubleArrKey")
126126
.withValue(Arrays.asList(1.0d, 2.0d))
127-
.withType(AttributeNameValueModel.Type.DOUBLE_ARRAY),
127+
.withType(AttributeNameValueModel.AttributeType.DOUBLE_ARRAY),
128128
new AttributeNameValueModel()
129129
.withName("floatArrKey")
130130
.withValue(Arrays.asList(1.0f, 2.0f))
131-
.withType(AttributeNameValueModel.Type.DOUBLE_ARRAY),
131+
.withType(AttributeNameValueModel.AttributeType.DOUBLE_ARRAY),
132132
new AttributeNameValueModel()
133133
.withName("boolArrKey")
134134
.withValue(Arrays.asList(true, false))
135-
.withType(AttributeNameValueModel.Type.BOOL_ARRAY)),
135+
.withType(AttributeNameValueModel.AttributeType.BOOL_ARRAY)),
136136
mock(SpiHelper.class),
137137
Collections.emptyList()))
138138
.isEqualTo(expectedAttributes);

0 commit comments

Comments
 (0)