Skip to content

Commit 5028698

Browse files
authored
OTLP: remove feature flag (#135401)
1 parent 5c69cd1 commit 5028698

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

docs/changelog/135401.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135401
2+
summary: "Adds an OTLP metrics endpoint (`_otlp/v1/metrics`) as tech preview"
3+
area: TSDB
4+
type: enhancement
5+
issues: []

x-pack/plugin/otel-data/src/javaRestTest/java/org/elasticsearch/xpack/oteldata/otlp/OTLPMetricsIndexingRestIT.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.elasticsearch.common.settings.SecureString;
3636
import org.elasticsearch.common.settings.Settings;
3737
import org.elasticsearch.common.util.concurrent.ThreadContext;
38-
import org.elasticsearch.rest.RestStatus;
3938
import org.elasticsearch.test.cluster.ElasticsearchCluster;
4039
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
4140
import org.elasticsearch.test.rest.ESRestTestCase;
@@ -108,13 +107,6 @@ public void beforeTest() throws Exception {
108107
)
109108
.build();
110109
assertBusy(() -> assertOK(client().performRequest(new Request("GET", "_index_template/metrics-otel@template"))));
111-
boolean otlpEndpointEnabled = false;
112-
try {
113-
otlpEndpointEnabled = RestStatus.isSuccessful(
114-
client().performRequest(new Request("POST", "/_otlp/v1/metrics")).getStatusLine().getStatusCode()
115-
);
116-
} catch (Exception ignore) {}
117-
assumeTrue("Requires otlp_metrics feature flag to be enabled", otlpEndpointEnabled);
118110
}
119111

120112
@Override

x-pack/plugin/otel-data/src/main/java/org/elasticsearch/xpack/oteldata/OTelPlugin.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.elasticsearch.common.settings.Setting;
2020
import org.elasticsearch.common.settings.Settings;
2121
import org.elasticsearch.common.settings.SettingsFilter;
22-
import org.elasticsearch.common.util.FeatureFlag;
2322
import org.elasticsearch.features.NodeFeature;
2423
import org.elasticsearch.plugins.ActionPlugin;
2524
import org.elasticsearch.plugins.Plugin;
@@ -48,7 +47,6 @@ public class OTelPlugin extends Plugin implements ActionPlugin {
4847

4948
private static final Logger logger = LogManager.getLogger(OTelPlugin.class);
5049

51-
private static final boolean OTLP_METRICS_ENABLED = new FeatureFlag("otlp_metrics").isEnabled();
5250
private final SetOnce<OTelIndexTemplateRegistry> registry = new SetOnce<>();
5351
private final boolean enabled;
5452

@@ -68,11 +66,7 @@ public Collection<RestHandler> getRestHandlers(
6866
Supplier<DiscoveryNodes> nodesInCluster,
6967
Predicate<NodeFeature> clusterSupportsFeature
7068
) {
71-
if (OTLP_METRICS_ENABLED) {
72-
return List.of(new OTLPMetricsRestAction());
73-
} else {
74-
return List.of();
75-
}
69+
return List.of(new OTLPMetricsRestAction());
7670
}
7771

7872
@Override
@@ -103,10 +97,6 @@ public List<Setting<?>> getSettings() {
10397

10498
@Override
10599
public Collection<ActionHandler> getActions() {
106-
if (OTLP_METRICS_ENABLED) {
107-
return List.of(new ActionHandler(OTLPMetricsTransportAction.TYPE, OTLPMetricsTransportAction.class));
108-
} else {
109-
return List.of();
110-
}
100+
return List.of(new ActionHandler(OTLPMetricsTransportAction.TYPE, OTLPMetricsTransportAction.class));
111101
}
112102
}

0 commit comments

Comments
 (0)