Skip to content

Commit e98de18

Browse files
committed
Reflect changes as of 2/10
1 parent 4d1b409 commit e98de18

File tree

7 files changed

+55
-48
lines changed

7 files changed

+55
-48
lines changed

exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,16 @@ public static void configureOtlpExporterBuilder(
201201
setTimeout.accept(Duration.ofMillis(timeoutMs));
202202
}
203203

204-
String certificatePath = config.getString("certificate");
205-
String clientKeyPath = config.getString("client_key");
206-
String clientKeyChainPath = config.getString("client_certificate");
204+
String certificatePath = config.getString("certificate_file");
205+
String clientKeyPath = config.getString("client_key_file");
206+
String clientKeyChainPath = config.getString("client_certificate_file");
207207

208208
if (clientKeyPath != null && clientKeyChainPath == null) {
209209
throw new ConfigurationException(
210-
"client_key provided without client_certificate - both client_key and client_certificate must be set");
210+
"client_key provided without client_certificate - both client_key_file and client_certificate_file must be set");
211211
} else if (clientKeyPath == null && clientKeyChainPath != null) {
212212
throw new ConfigurationException(
213-
"client_certificate provided without client_key - both client_key and client_certificate must be set");
213+
"client_certificate provided without client_key - both client_key_file and client_certificate_file must be set");
214214
}
215215
byte[] certificateBytes = readFileBytes(certificatePath);
216216
if (certificateBytes != null) {

sdk-extensions/incubator/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ 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 = "041ff2539bbdf2bf71f27305da83cde90968eff7"
63+
val configurationRef = "c8014d610e6923f51708dd24787231f1796eafdc"
6464
val configurationRepoZip = "https://github.com/open-telemetry/opentelemetry-configuration/archive/$configurationRef.zip"
6565
val buildDirectory = layout.buildDirectory.asFile.get()
6666

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ void parseAndCreate_Examples(@TempDir Path tempDir)
7575
String rewrittenExampleContent =
7676
exampleContent
7777
.replaceAll(
78-
"certificate: .*\n",
79-
"certificate: " + certificatePath.replace("\\", "\\\\") + System.lineSeparator())
78+
"certificate_file: .*\n",
79+
"certificate_file: "
80+
+ certificatePath.replace("\\", "\\\\")
81+
+ System.lineSeparator())
8082
.replaceAll(
81-
"client_key: .*\n",
82-
"client_key: " + clientKeyPath.replace("\\", "\\\\") + System.lineSeparator())
83+
"client_key_file: .*\n",
84+
"client_key_file: "
85+
+ clientKeyPath.replace("\\", "\\\\")
86+
+ System.lineSeparator())
8387
.replaceAll(
84-
"client_certificate: .*\n",
85-
"client_certificate: "
88+
"client_certificate_file: .*\n",
89+
"client_certificate_file: "
8690
+ clientCertificatePath.replace("\\", "\\\\")
8791
+ System.lineSeparator());
8892
InputStream is =

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ void parse_KitchenSinkExampleFile() throws IOException {
201201
.withOtlpHttp(
202202
new OtlpHttpExporterModel()
203203
.withEndpoint("http://localhost:4318/v1/traces")
204-
.withCertificate("/app/cert.pem")
205-
.withClientKey("/app/cert.pem")
206-
.withClientCertificate("/app/cert.pem")
204+
.withCertificateFile("/app/cert.pem")
205+
.withClientKeyFile("/app/cert.pem")
206+
.withClientCertificateFile("/app/cert.pem")
207207
.withHeaders(
208208
Collections.singletonList(
209209
new NameStringValuePairModel()
@@ -252,9 +252,9 @@ void parse_KitchenSinkExampleFile() throws IOException {
252252
.withOtlpHttp(
253253
new OtlpHttpExporterModel()
254254
.withEndpoint("http://localhost:4318/v1/logs")
255-
.withCertificate("/app/cert.pem")
256-
.withClientKey("/app/cert.pem")
257-
.withClientCertificate("/app/cert.pem")
255+
.withCertificateFile("/app/cert.pem")
256+
.withClientKeyFile("/app/cert.pem")
257+
.withClientCertificateFile("/app/cert.pem")
258258
.withHeaders(
259259
Collections.singletonList(
260260
new NameStringValuePairModel()
@@ -310,9 +310,9 @@ void parse_KitchenSinkExampleFile() throws IOException {
310310
.withOtlpHttp(
311311
new OtlpHttpMetricExporterModel()
312312
.withEndpoint("http://localhost:4318/v1/metrics")
313-
.withCertificate("/app/cert.pem")
314-
.withClientKey("/app/cert.pem")
315-
.withClientCertificate("/app/cert.pem")
313+
.withCertificateFile("/app/cert.pem")
314+
.withClientKeyFile("/app/cert.pem")
315+
.withClientCertificateFile("/app/cert.pem")
316316
.withHeaders(
317317
Collections.singletonList(
318318
new NameStringValuePairModel()

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ void create_OtlpDefaults() {
8787
assertThat(configProperties.getStructured("headers")).isNull();
8888
assertThat(configProperties.getString("compression")).isNull();
8989
assertThat(configProperties.getInt("timeout")).isNull();
90-
assertThat(configProperties.getString("certificate")).isNull();
91-
assertThat(configProperties.getString("client_key")).isNull();
92-
assertThat(configProperties.getString("client_certificate")).isNull();
90+
assertThat(configProperties.getString("certificate_file")).isNull();
91+
assertThat(configProperties.getString("client_key_file")).isNull();
92+
assertThat(configProperties.getString("client_certificate_file")).isNull();
9393
}
9494

9595
@Test
@@ -135,9 +135,9 @@ void create_OtlpConfigured(@TempDir Path tempDir)
135135
.withValue("value2")))
136136
.withCompression("gzip")
137137
.withTimeout(15_000)
138-
.withCertificate(certificatePath)
139-
.withClientKey(clientKeyPath)
140-
.withClientCertificate(clientCertificatePath)),
138+
.withCertificateFile(certificatePath)
139+
.withClientKeyFile(clientKeyPath)
140+
.withClientCertificateFile(clientCertificatePath)),
141141
spiHelper,
142142
closeables);
143143
cleanup.addCloseable(exporter);
@@ -165,9 +165,10 @@ void create_OtlpConfigured(@TempDir Path tempDir)
165165
});
166166
assertThat(configProperties.getString("compression")).isEqualTo("gzip");
167167
assertThat(configProperties.getInt("timeout")).isEqualTo(Duration.ofSeconds(15).toMillis());
168-
assertThat(configProperties.getString("certificate")).isEqualTo(certificatePath);
169-
assertThat(configProperties.getString("client_key")).isEqualTo(clientKeyPath);
170-
assertThat(configProperties.getString("client_certificate")).isEqualTo(clientCertificatePath);
168+
assertThat(configProperties.getString("certificate_file")).isEqualTo(certificatePath);
169+
assertThat(configProperties.getString("client_key_file")).isEqualTo(clientKeyPath);
170+
assertThat(configProperties.getString("client_certificate_file"))
171+
.isEqualTo(clientCertificatePath);
171172
}
172173

173174
@Test

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ void create_OtlpDefaults() {
8989
assertThat(configProperties.getStructured("headers")).isNull();
9090
assertThat(configProperties.getString("compression")).isNull();
9191
assertThat(configProperties.getInt("timeout")).isNull();
92-
assertThat(configProperties.getString("certificate")).isNull();
93-
assertThat(configProperties.getString("client_key")).isNull();
94-
assertThat(configProperties.getString("client_certificate")).isNull();
92+
assertThat(configProperties.getString("certificate_file")).isNull();
93+
assertThat(configProperties.getString("client_key_file")).isNull();
94+
assertThat(configProperties.getString("client_certificate_file")).isNull();
9595
assertThat(configProperties.getString("temporality_preference")).isNull();
9696
assertThat(configProperties.getString("default_histogram_aggregation")).isNull();
9797
}
@@ -143,9 +143,9 @@ void create_OtlpConfigured(@TempDir Path tempDir)
143143
.withValue("value2")))
144144
.withCompression("gzip")
145145
.withTimeout(15_000)
146-
.withCertificate(certificatePath)
147-
.withClientKey(clientKeyPath)
148-
.withClientCertificate(clientCertificatePath)
146+
.withCertificateFile(certificatePath)
147+
.withClientKeyFile(clientKeyPath)
148+
.withClientCertificateFile(clientCertificatePath)
149149
.withTemporalityPreference(
150150
OtlpHttpMetricExporterModel.ExporterTemporalityPreference.DELTA)
151151
.withDefaultHistogramAggregation(
@@ -178,9 +178,10 @@ void create_OtlpConfigured(@TempDir Path tempDir)
178178
});
179179
assertThat(configProperties.getString("compression")).isEqualTo("gzip");
180180
assertThat(configProperties.getInt("timeout")).isEqualTo(Duration.ofSeconds(15).toMillis());
181-
assertThat(configProperties.getString("certificate")).isEqualTo(certificatePath);
182-
assertThat(configProperties.getString("client_key")).isEqualTo(clientKeyPath);
183-
assertThat(configProperties.getString("client_certificate")).isEqualTo(clientCertificatePath);
181+
assertThat(configProperties.getString("certificate_file")).isEqualTo(certificatePath);
182+
assertThat(configProperties.getString("client_key_file")).isEqualTo(clientKeyPath);
183+
assertThat(configProperties.getString("client_certificate_file"))
184+
.isEqualTo(clientCertificatePath);
184185
assertThat(configProperties.getString("temporality_preference")).isEqualTo("delta");
185186
assertThat(configProperties.getString("default_histogram_aggregation"))
186187
.isEqualTo("base2_exponential_bucket_histogram");

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ void create_OtlpDefaults() {
8787
assertThat(configProperties.getStructured("headers")).isNull();
8888
assertThat(configProperties.getString("compression")).isNull();
8989
assertThat(configProperties.getInt("timeout")).isNull();
90-
assertThat(configProperties.getString("certificate")).isNull();
91-
assertThat(configProperties.getString("client_key")).isNull();
92-
assertThat(configProperties.getString("client_certificate")).isNull();
90+
assertThat(configProperties.getString("certificate_file")).isNull();
91+
assertThat(configProperties.getString("client_key_file")).isNull();
92+
assertThat(configProperties.getString("client_certificate_file")).isNull();
9393
}
9494

9595
@Test
@@ -135,9 +135,9 @@ void create_OtlpConfigured(@TempDir Path tempDir)
135135
.withValue("value2")))
136136
.withCompression("gzip")
137137
.withTimeout(15_000)
138-
.withCertificate(certificatePath)
139-
.withClientKey(clientKeyPath)
140-
.withClientCertificate(clientCertificatePath)),
138+
.withCertificateFile(certificatePath)
139+
.withClientKeyFile(clientKeyPath)
140+
.withClientCertificateFile(clientCertificatePath)),
141141
spiHelper,
142142
closeables);
143143
cleanup.addCloseable(exporter);
@@ -165,9 +165,10 @@ void create_OtlpConfigured(@TempDir Path tempDir)
165165
});
166166
assertThat(configProperties.getString("compression")).isEqualTo("gzip");
167167
assertThat(configProperties.getInt("timeout")).isEqualTo(Duration.ofSeconds(15).toMillis());
168-
assertThat(configProperties.getString("certificate")).isEqualTo(certificatePath);
169-
assertThat(configProperties.getString("client_key")).isEqualTo(clientKeyPath);
170-
assertThat(configProperties.getString("client_certificate")).isEqualTo(clientCertificatePath);
168+
assertThat(configProperties.getString("certificate_file")).isEqualTo(certificatePath);
169+
assertThat(configProperties.getString("client_key_file")).isEqualTo(clientKeyPath);
170+
assertThat(configProperties.getString("client_certificate_file"))
171+
.isEqualTo(clientCertificatePath);
171172
}
172173

173174
@Test

0 commit comments

Comments
 (0)