Skip to content

Commit 142e4ea

Browse files
committed
Revert "Otel metrics source http service (#6604)"
This reverts commit bb61dbe.
1 parent 610e8e8 commit 142e4ea

22 files changed

Lines changed: 1464 additions & 1849 deletions

File tree

data-prepper-plugins/otel-logs-source/src/test/java/org/opensearch/dataprepper/plugins/source/otellogs/OtelLogsSourceConfigFixture.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import static org.opensearch.dataprepper.plugins.source.otellogs.OTelLogsSourceConfig.DEFAULT_REQUEST_TIMEOUT_MS;
1515
import static org.opensearch.dataprepper.plugins.source.otellogs.OtelLogsSourceConfigTestData.BASIC_AUTH_PASSWORD;
1616
import static org.opensearch.dataprepper.plugins.source.otellogs.OtelLogsSourceConfigTestData.BASIC_AUTH_USERNAME;
17-
import static org.opensearch.dataprepper.plugins.source.otellogs.OtelLogsSourceConfigTestData.CONFIG_HTTP_PATH;
1817

1918
import java.util.Map;
2019

@@ -42,7 +41,6 @@ public static OTelLogsSourceConfig createDefaultConfig() {
4241
public static OTelLogsSourceConfig.OTelLogsSourceConfigBuilder createDefaultConfigBuilder() {
4342
return OTelLogsSourceConfig.builder()
4443
.healthCheck(true)
45-
.httpPath(CONFIG_HTTP_PATH)
4644
.port(DEFAULT_PORT)
4745
.enableUnframedRequests(false)
4846
.ssl(false)

data-prepper-plugins/otel-metrics-source/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies {
1515
implementation project(':data-prepper-plugins:armeria-common')
1616
implementation project(':data-prepper-plugins:otel-proto-common')
1717
implementation project(':data-prepper-plugins:http-common')
18-
implementation project(':data-prepper-plugins:http-source-common' )
1918
testImplementation project(':data-prepper-api').sourceSets.test.output
2019
implementation libs.opentelemetry.proto
2120
implementation libs.commons.io
@@ -35,8 +34,6 @@ dependencies {
3534
testImplementation 'org.assertj:assertj-core:3.27.7'
3635
testImplementation libs.commons.io
3736
testImplementation 'org.skyscreamer:jsonassert:1.5.3'
38-
implementation 'org.projectlombok:lombok:1.18.26'
39-
annotationProcessor 'org.projectlombok:lombok:1.18.26'
4037
}
4138

4239
jacocoTestCoverageVerification {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.opensearch.dataprepper.plugins.source.otelmetrics;
2+
3+
import org.opensearch.dataprepper.plugins.server.ServerConfiguration;
4+
5+
public class ConvertConfiguration {
6+
7+
public static ServerConfiguration convertConfiguration(final OTelMetricsSourceConfig oTelMetricsSourceConfig) {
8+
ServerConfiguration serverConfiguration = new ServerConfiguration();
9+
serverConfiguration.setPath(oTelMetricsSourceConfig.getPath());
10+
serverConfiguration.setHealthCheck(oTelMetricsSourceConfig.hasHealthCheck());
11+
serverConfiguration.setProtoReflectionService(oTelMetricsSourceConfig.hasProtoReflectionService());
12+
serverConfiguration.setRequestTimeoutInMillis(oTelMetricsSourceConfig.getRequestTimeoutInMillis());
13+
serverConfiguration.setEnableUnframedRequests(oTelMetricsSourceConfig.enableUnframedRequests());
14+
serverConfiguration.setCompression(oTelMetricsSourceConfig.getCompression());
15+
serverConfiguration.setAuthentication(oTelMetricsSourceConfig.getAuthentication());
16+
serverConfiguration.setSsl(oTelMetricsSourceConfig.isSsl());
17+
serverConfiguration.setUnauthenticatedHealthCheck(oTelMetricsSourceConfig.isUnauthenticatedHealthCheck());
18+
serverConfiguration.setUseAcmCertForSSL(oTelMetricsSourceConfig.useAcmCertForSSL());
19+
serverConfiguration.setMaxRequestLength(oTelMetricsSourceConfig.getMaxRequestLength());
20+
serverConfiguration.setPort(oTelMetricsSourceConfig.getPort());
21+
serverConfiguration.setRetryInfo(oTelMetricsSourceConfig.getRetryInfo());
22+
serverConfiguration.setThreadCount(oTelMetricsSourceConfig.getThreadCount());
23+
serverConfiguration.setMaxConnectionCount(oTelMetricsSourceConfig.getMaxConnectionCount());
24+
25+
return serverConfiguration;
26+
}
27+
}

data-prepper-plugins/otel-metrics-source/src/main/java/org/opensearch/dataprepper/plugins/source/otelmetrics/OTelMetricsGrpcService.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/*
22
* Copyright OpenSearch Contributors
33
* SPDX-License-Identifier: Apache-2.0
4-
*
5-
* The OpenSearch Contributors require contributions made to
6-
* this file be licensed under the Apache-2.0 license or a
7-
* compatible open source license.
8-
*
94
*/
105

116
package org.opensearch.dataprepper.plugins.source.otelmetrics;

data-prepper-plugins/otel-metrics-source/src/main/java/org/opensearch/dataprepper/plugins/source/otelmetrics/OTelMetricsSource.java

Lines changed: 42 additions & 242 deletions
Large diffs are not rendered by default.

data-prepper-plugins/otel-metrics-source/src/main/java/org/opensearch/dataprepper/plugins/source/otelmetrics/OTelMetricsSourceConfig.java

Lines changed: 101 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
/*
22
* Copyright OpenSearch Contributors
33
* SPDX-License-Identifier: Apache-2.0
4-
*
5-
* The OpenSearch Contributors require contributions made to
6-
* this file be licensed under the Apache-2.0 license or a
7-
* compatible open source license.
8-
*
94
*/
105

116
package org.opensearch.dataprepper.plugins.source.otelmetrics;
127

138
import com.fasterxml.jackson.annotation.JsonProperty;
149
import jakarta.validation.constraints.AssertTrue;
1510
import jakarta.validation.constraints.Size;
16-
import lombok.AllArgsConstructor;
17-
import lombok.Builder;
18-
import lombok.Getter;
19-
import lombok.NoArgsConstructor;
20-
2111
import org.apache.commons.lang3.StringUtils;
2212
import org.opensearch.dataprepper.model.types.ByteCount;
2313
import org.opensearch.dataprepper.plugins.codec.CompressionOption;
@@ -27,11 +17,6 @@
2717

2818
import java.util.Set;
2919

30-
31-
@Builder
32-
@AllArgsConstructor
33-
@NoArgsConstructor
34-
@Getter
3520
public class OTelMetricsSourceConfig {
3621
static final String REQUEST_TIMEOUT = "request_timeout";
3722
static final String PORT = "port";
@@ -67,9 +52,6 @@ public class OTelMetricsSourceConfig {
6752
static final String UNAUTHENTICATED_HEALTH_CHECK = "unauthenticated_health_check";
6853
private static final String NAME_KEY = "name";
6954
private static final String SERVICE_NAME_KEY = "service_name";
70-
static final String HTTP_PATH = "http_path";
71-
static final String AUTHENTICATION = "authentication";
72-
static final String MAX_REQUEST_LENGTH = "max_request_length";
7355

7456
@JsonProperty(REQUEST_TIMEOUT)
7557
private int requestTimeoutInMillis = DEFAULT_REQUEST_TIMEOUT_MS;
@@ -129,7 +111,7 @@ public class OTelMetricsSourceConfig {
129111
@JsonProperty(MAX_CONNECTION_COUNT)
130112
private int maxConnectionCount = DEFAULT_MAX_CONNECTION_COUNT;
131113

132-
@JsonProperty(AUTHENTICATION)
114+
@JsonProperty("authentication")
133115
private PluginModel authentication;
134116

135117
@JsonProperty(UNAUTHENTICATED_HEALTH_CHECK)
@@ -138,16 +120,12 @@ public class OTelMetricsSourceConfig {
138120
@JsonProperty(COMPRESSION)
139121
private CompressionOption compression = CompressionOption.NONE;
140122

141-
@JsonProperty(MAX_REQUEST_LENGTH)
123+
@JsonProperty("max_request_length")
142124
private ByteCount maxRequestLength;
143125

144126
@JsonProperty(RETRY_INFO)
145127
private RetryInfoConfig retryInfo;
146128

147-
@JsonProperty(HTTP_PATH)
148-
@Size(min = 1, message = "path length should be at least 1")
149-
private String httpPath;
150-
151129
@AssertTrue(message = "buffer_partition_keys only supports 'name' and 'service_name'. 'name' is mandatory")
152130
boolean isBufferKeysValid() {
153131
if (bufferPartitionKeys == null) {
@@ -195,8 +173,106 @@ private boolean isSSLCertificateLocatedInS3() {
195173
sslKeyFile.toLowerCase().startsWith(S3_PREFIX);
196174
}
197175

176+
public int getRequestTimeoutInMillis() {
177+
return requestTimeoutInMillis;
178+
}
179+
180+
public int getPort() {
181+
return port;
182+
}
183+
184+
public String getPath() {
185+
return path;
186+
}
187+
188+
public boolean hasHealthCheck() {
189+
return healthCheck;
190+
}
191+
192+
public Set<String> getBufferPartitionKeys() {
193+
return bufferPartitionKeys;
194+
}
195+
198196
public boolean enableHttpHealthCheck() {
199-
return isEnableUnframedRequests() && isHealthCheck();
197+
return enableUnframedRequests() && hasHealthCheck();
198+
}
199+
200+
public boolean hasProtoReflectionService() {
201+
return protoReflectionService;
202+
}
203+
204+
public boolean enableUnframedRequests() {
205+
return enableUnframedRequests;
206+
}
207+
208+
public boolean isSsl() {
209+
return ssl;
210+
}
211+
212+
public OTelOutputFormat getOutputFormat() {
213+
return outputFormat;
214+
}
215+
216+
public boolean useAcmCertForSSL() {
217+
return useAcmCertForSSL;
218+
}
219+
220+
public long getAcmCertIssueTimeOutMillis() {
221+
return acmCertIssueTimeOutMillis;
222+
}
223+
224+
public String getSslKeyCertChainFile() {
225+
return sslKeyCertChainFile;
226+
}
227+
228+
public String getSslKeyFile() {
229+
return sslKeyFile;
230+
}
231+
232+
public String getAcmCertificateArn() {
233+
return acmCertificateArn;
234+
}
235+
236+
public String getAcmPrivateKeyPassword() {
237+
return acmPrivateKeyPassword;
238+
}
239+
240+
public boolean isSslCertAndKeyFileInS3() {
241+
return sslCertAndKeyFileInS3;
242+
}
243+
244+
public String getAwsRegion() {
245+
return awsRegion;
246+
}
247+
248+
public int getThreadCount() {
249+
return threadCount;
250+
}
251+
252+
public int getMaxConnectionCount() {
253+
return maxConnectionCount;
254+
}
255+
256+
public PluginModel getAuthentication() { return authentication; }
257+
258+
public boolean isUnauthenticatedHealthCheck() {
259+
return unauthenticatedHealthCheck;
260+
}
261+
262+
public CompressionOption getCompression() {
263+
return compression;
264+
}
265+
266+
public ByteCount getMaxRequestLength() {
267+
return maxRequestLength;
268+
}
269+
270+
public RetryInfoConfig getRetryInfo() {
271+
return retryInfo;
272+
}
273+
274+
public void setRetryInfo(RetryInfoConfig retryInfo) {
275+
this.retryInfo = retryInfo;
200276
}
201277
}
202278

data-prepper-plugins/otel-metrics-source/src/main/java/org/opensearch/dataprepper/plugins/source/otelmetrics/certificate/CertificateProviderFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public CertificateProviderFactory(final OTelMetricsSourceConfig oTelMetricsSourc
4242

4343
public CertificateProvider getCertificateProvider() {
4444
// ACM Cert for SSL takes preference
45-
if (oTelMetricsSourceConfig.isUseAcmCertForSSL()) {
45+
if (oTelMetricsSourceConfig.useAcmCertForSSL()) {
4646
LOG.info("Using ACM certificate and private key for SSL/TLS.");
4747
final AwsCredentialsProvider credentialsProvider = AwsCredentialsProviderChain.builder()
4848
.addCredentialsProvider(DefaultCredentialsProvider.create()).build();

data-prepper-plugins/otel-metrics-source/src/main/java/org/opensearch/dataprepper/plugins/source/otelmetrics/http/ArmeriaHttpService.java

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

0 commit comments

Comments
 (0)