From f9d050d709f9c2bfb0b8d42acc0695929025018b Mon Sep 17 00:00:00 2001 From: James Netherton Date: Tue, 11 Feb 2025 13:04:43 +0000 Subject: [PATCH] Remove obserability-services config workaround for /observe endpoint tracing Fixes #6967 --- .../ObservabilityServicesProcessor.java | 9 ---- ...ervabilityServicesConfigSourceFactory.java | 54 ------------------- ...rvabilityServicesRuntimeConfigBuilder.java | 27 ---------- 3 files changed, 90 deletions(-) delete mode 100644 extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java delete mode 100644 extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java diff --git a/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java b/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java index 63be81aa2599..4d8027ac5ebb 100644 --- a/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java +++ b/extensions/observability-services/deployment/src/main/java/org/apache/camel/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java @@ -18,9 +18,6 @@ import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.RunTimeConfigBuilderBuildItem; -import io.quarkus.opentelemetry.deployment.tracing.TracerEnabled; -import org.apache.camel.quarkus.component.observabilityservices.ObservabilityServicesRuntimeConfigBuilder; class ObservabilityServicesProcessor { private static final String FEATURE = "camel-observability-services"; @@ -29,10 +26,4 @@ class ObservabilityServicesProcessor { FeatureBuildItem feature() { return new FeatureBuildItem(FEATURE); } - - // TODO: Remove this https://github.com/apache/camel-quarkus/issues/6967 - @BuildStep(onlyIf = TracerEnabled.class) - RunTimeConfigBuilderBuildItem observabilityServicesRuntimeConfiguration() { - return new RunTimeConfigBuilderBuildItem(ObservabilityServicesRuntimeConfigBuilder.class); - } } diff --git a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java b/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java deleted file mode 100644 index 2d2d7714db46..000000000000 --- a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesConfigSourceFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.component.observabilityservices; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import io.smallrye.config.ConfigSourceContext; -import io.smallrye.config.ConfigSourceFactory; -import io.smallrye.config.ConfigValue; -import io.smallrye.config.PropertiesConfigSource; -import org.apache.camel.util.ObjectHelper; -import org.eclipse.microprofile.config.spi.ConfigSource; - -/** - * TODO: Remove this https://github.com/apache/camel-quarkus/issues/6967 - */ -public class ObservabilityServicesConfigSourceFactory implements ConfigSourceFactory { - @Override - public Iterable getConfigSources(ConfigSourceContext context) { - ConfigValue sdkDisabled = context.getValue("quarkus.otel.sdk.disabled"); - - if (sdkDisabled != null && sdkDisabled.getValue().equals("false")) { - Map properties = new HashMap<>(1); - ConfigValue otelSuppressedUris = context.getValue("quarkus.otel.traces.suppress-application-uris"); - String suppressedEndpoints = "/observe/*"; - - if (otelSuppressedUris != null && ObjectHelper.isNotEmpty(otelSuppressedUris.getValue())) { - suppressedEndpoints += "," + otelSuppressedUris.getValue(); - } - - properties.put("quarkus.otel.traces.suppress-application-uris", suppressedEndpoints); - return Set.of(new PropertiesConfigSource(properties, "camel-quarkus-observability-services", 300)); - } - - return Collections.emptySet(); - } -} diff --git a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java b/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java deleted file mode 100644 index 3a382cc37e0b..000000000000 --- a/extensions/observability-services/runtime/src/main/java/org.apache.camel.quarkus.component.observabilityservices/ObservabilityServicesRuntimeConfigBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.quarkus.component.observabilityservices; - -import io.quarkus.runtime.configuration.ConfigBuilder; -import io.smallrye.config.SmallRyeConfigBuilder; - -public class ObservabilityServicesRuntimeConfigBuilder implements ConfigBuilder { - @Override - public SmallRyeConfigBuilder configBuilder(SmallRyeConfigBuilder builder) { - return builder.withSources(new ObservabilityServicesConfigSourceFactory()); - } -}