Skip to content

Commit cc51d5d

Browse files
authored
Putting the ingest otel processor behind the logs stream feature flag (#129667) (#129783)
1 parent 8bd93f7 commit cc51d5d

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

modules/ingest-otel/src/main/java/org/elasticsearch/ingest/otel/NormalizeForStreamPlugin.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.ingest.otel;
1111

12+
import org.elasticsearch.cluster.metadata.DataStream;
1213
import org.elasticsearch.ingest.Processor;
1314
import org.elasticsearch.plugins.IngestPlugin;
1415
import org.elasticsearch.plugins.Plugin;
@@ -19,6 +20,10 @@ public class NormalizeForStreamPlugin extends Plugin implements IngestPlugin {
1920

2021
@Override
2122
public Map<String, Processor.Factory> getProcessors(Processor.Parameters parameters) {
22-
return Map.of(NormalizeForStreamProcessor.TYPE, new NormalizeForStreamProcessor.Factory());
23+
if (DataStream.LOGS_STREAM_FEATURE_FLAG) {
24+
return Map.of(NormalizeForStreamProcessor.TYPE, new NormalizeForStreamProcessor.Factory());
25+
} else {
26+
return Map.of();
27+
}
2328
}
2429
}

modules/ingest-otel/src/yamlRestTest/java/org/elasticsearch/ingest/otel/IngestOtelClientYamlTestSuiteIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1414

1515
import org.elasticsearch.test.cluster.ElasticsearchCluster;
16+
import org.elasticsearch.test.cluster.FeatureFlag;
1617
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
1718
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
1819
import org.junit.ClassRule;
@@ -24,7 +25,10 @@ public IngestOtelClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate tes
2425
}
2526

2627
@ClassRule
27-
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("ingest-otel").build();
28+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
29+
.module("ingest-otel")
30+
.feature(FeatureFlag.LOGS_STREAM)
31+
.build();
2832

2933
@Override
3034
protected String getTestRestCluster() {

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
public enum FeatureFlag {
1919
TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
2020
SUB_OBJECTS_AUTO_ENABLED("es.sub_objects_auto_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
21-
INFERENCE_CUSTOM_SERVICE_ENABLED("es.inference_custom_service_feature_flag_enabled=true", Version.fromString("8.19.0"), null);
21+
INFERENCE_CUSTOM_SERVICE_ENABLED("es.inference_custom_service_feature_flag_enabled=true", Version.fromString("8.19.0"), null),
22+
LOGS_STREAM("es.logs_stream_feature_flag_enabled=true", Version.fromString("8.19.0"), null);
2223

2324
public final String systemProperty;
2425
public final Version from;

0 commit comments

Comments
 (0)