diff --git a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/OpenTracingConfigSource.java b/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/OpenTracingConfigSource.java deleted file mode 100644 index 936e3e12e9a78..0000000000000 --- a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/OpenTracingConfigSource.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (C) 2006-2023 Talend Inc. - www.talend.com - * - * Licensed 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.talend.sdk.component.server.configuration; - -import static java.lang.System.getenv; -import static java.util.Optional.ofNullable; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.microprofile.config.spi.ConfigSource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class OpenTracingConfigSource implements ConfigSource { - - private final static Logger LOGGER = LoggerFactory.getLogger(OpenTracingConfigSource.class); - - private final Map configuration = new HashMap() { - - { - int tracingRate; - try { - tracingRate = ofNullable(getenv("TRACING_SAMPLING_RATE")).map(Integer::parseInt).orElse(1); - } catch (final NumberFormatException e) { - LOGGER.warn("Can't parse value of environment property TRACING_SAMPLING_RATE", e.getMessage()); - tracingRate = 1; - } - - final String isTracingOn = String.valueOf(Boolean.parseBoolean(getenv("TRACING_ON")) && tracingRate == 1); - put("geronimo.opentracing.filter.active", isTracingOn); - put("span.converter.zipkin.active", isTracingOn); - put("span.converter.zipkin.logger.active", isTracingOn); - } - }; - - @Override - public Map getProperties() { - return configuration; - } - - @Override - public int getOrdinal() { - return 2000; - } - - @Override - public String getValue(final String propertyName) { - return configuration.get(propertyName); - } - - @Override - public String getName() { - return "talend-opentracing"; - } -} diff --git a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/PropertiesSetup.java b/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/PropertiesSetup.java index f3e11e2680491..7e373d11c13ef 100644 --- a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/PropertiesSetup.java +++ b/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/configuration/PropertiesSetup.java @@ -41,10 +41,6 @@ public void accept(final Configuration configuration) { checkOrSetProperty("talend.component.manager.services.cache.eviction.defaultEvictionTimeout", "30000"); checkOrSetProperty("talend.component.manager.services.cache.eviction.defaultMaxSize", "5000"); checkOrSetProperty("talend.component.manager.services.cache.eviction.maxDeletionPerEvictionRun", "-1"); - // By default we want to skip vault calls zipkin logs, we can still override it... - System.setProperty("geronimo.opentracing.client.filter.request.skip", "true"); - System.setProperty("geronimo.opentracing.filter.skippedTracing.urls", ".*/login$,.*/decrypt/.*"); - System.setProperty("geronimo.opentracing.filter.skippedTracing.matcherType", "regex"); // listening port order: `meecrowave cli --http=x` > `-Dhttp=x` > `-e TALEND_COMPONENT_SERVER_PORT=x` final String port = System.getProperty("http") != null ? System.getProperty("http") : System.getenv("TALEND_COMPONENT_SERVER_PORT"); diff --git a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/ComponentResourceImpl.java b/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/ComponentResourceImpl.java index 72668808cf7f6..b2a538f717693 100644 --- a/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/ComponentResourceImpl.java +++ b/component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/ComponentResourceImpl.java @@ -220,12 +220,12 @@ public Dependencies getDependencies(final String[] ids) { final ComponentFamilyMeta.BaseMeta meta = componentDao.findById(id); if (meta == null) { - //Manage when the meta is null because of an unknown identifier + // Manage when the meta is null because of an unknown identifier throw new WebApplicationException(Response .status(Response.Status.NOT_FOUND) .type(APPLICATION_JSON_TYPE) .entity(new ErrorPayload(COMPONENT_MISSING, - "No component matching the id: " + id)) + "No component matching the id: " + id)) .build()); } @@ -248,14 +248,14 @@ public StreamingOutput getDependency(final String id) { .status(Response.Status.NOT_FOUND) .type(APPLICATION_JSON_TYPE) .entity(new ErrorPayload(PLUGIN_MISSING, - "No plugin matching the id: " + id)) + "No plugin matching the id: " + id)) .build())) .getContainerFile() .orElseThrow(() -> new WebApplicationException(Response .status(Response.Status.NOT_FOUND) .type(APPLICATION_JSON_TYPE) .entity(new ErrorPayload(PLUGIN_MISSING, - "No dependency matching the id: " + id)) + "No dependency matching the id: " + id)) .build())); if (!Files.exists(file)) { return onMissingJar(id); diff --git a/component-server-parent/component-server/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource b/component-server-parent/component-server/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource index 8cefa0e705f04..d27c642cbd072 100644 --- a/component-server-parent/component-server/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource +++ b/component-server-parent/component-server/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource @@ -1,3 +1,2 @@ org.talend.sdk.component.server.configuration.ScmConfigurationLoader -org.talend.sdk.component.server.configuration.ComponentConfigurationLoader -org.talend.sdk.component.server.configuration.OpenTracingConfigSource +org.talend.sdk.component.server.configuration.ComponentConfigurationLoader \ No newline at end of file diff --git a/component-tools/src/test/java/org/talend/sdk/component/tools/validator/SchemaValidatorTest.java b/component-tools/src/test/java/org/talend/sdk/component/tools/validator/SchemaValidatorTest.java index be2b3208cf5d5..bcbffe3bd17f1 100644 --- a/component-tools/src/test/java/org/talend/sdk/component/tools/validator/SchemaValidatorTest.java +++ b/component-tools/src/test/java/org/talend/sdk/component/tools/validator/SchemaValidatorTest.java @@ -58,10 +58,12 @@ void validateSchemaBuilderOKs() { } class MySchema implements Schema { + @Override public Builder toBuilder() { return null; } + @Override public Type getType() { return null; diff --git a/documentation/src/main/antora/modules/ROOT/pages/documentation-rest.adoc b/documentation/src/main/antora/modules/ROOT/pages/documentation-rest.adoc index 77c9e4a4d5fc1..08921917990ab 100644 --- a/documentation/src/main/antora/modules/ROOT/pages/documentation-rest.adoc +++ b/documentation/src/main/antora/modules/ROOT/pages/documentation-rest.adoc @@ -596,29 +596,6 @@ Events are logged in the following format: This profile is very close to the JSON profile and also adds the `LOG_KAFKA_TOPIC` and `LOG_KAFKA_URL` configuration. The difference is that it logs the default logs on Kafka in addition to the tracing logs. -==== OpenTracing - -The component server uses Geronimo OpenTracing to monitor request. - -The tracing can be activated by setting the `TRACING_ON` environment variable to `true`. - -The tracing rate is configurable by setting the `TRACING_SAMPLING_RATE` environment variable. -It accepts `0` (none) and `1` (all, default) as values to ensure the consistency of the reporting. - -TIP: You can find all the details on the configuration in `org.talend.sdk.component.server.configuration.OpenTracingConfigSource`. - -Run docker image with tracing on: - -[source,sh] ----- -sudo docker run -p 8080:8080 \ - -e TRACING_ON=true \ - tacokit/component-server ----- - -By default, Geronimo OpenTracing will log the spans in a Zipking format so you can use the Kafka profile as explained before -to wire it over any OpenTracing backend. - === Building the docker image You can register component server images in Docker using these instructions in the corresponding image directory: diff --git a/images/component-server-image/pom.xml b/images/component-server-image/pom.xml index 20eacd69b4de3..a1b507fcf3350 100644 --- a/images/component-server-image/pom.xml +++ b/images/component-server-image/pom.xml @@ -108,27 +108,6 @@ ${geronimo-metrics.version} - - io.opentracing - opentracing-api - ${opentracing.version} - - - org.eclipse.microprofile.opentracing - microprofile-opentracing-api - ${microprofile-opentracing.version} - - - org.osgi - org.osgi.annotation.versioning - - - - - org.apache.geronimo - geronimo-opentracing - ${geronimo-opentracing.version} - org.talend.daikon diff --git a/pom.xml b/pom.xml index 07e0982709ed9..eec49a4763f89 100644 --- a/pom.xml +++ b/pom.xml @@ -194,13 +194,10 @@ 1.6.0 1.3 1.1.1 - 1.2.1 1.1.1 1.0.2 - 0.31.0 1.0.12 1.0.3 - 1.0.2 1.2.2 5.10.0 4.8.1 diff --git a/vault-client/pom.xml b/vault-client/pom.xml index ef4f78cf745d2..0eaaf8514c8a1 100644 --- a/vault-client/pom.xml +++ b/vault-client/pom.xml @@ -74,27 +74,6 @@ log4j-jul ${log4j2.version} - - io.opentracing - opentracing-api - ${opentracing.version} - - - org.eclipse.microprofile.opentracing - microprofile-opentracing-api - ${microprofile-opentracing.version} - - - org.osgi - org.osgi.annotation.versioning - - - - - org.apache.geronimo - geronimo-opentracing - ${geronimo-opentracing.version} - org.apache.geronimo.specs diff --git a/vault-client/src/main/java/org/talend/sdk/components/vault/client/VaultClientSetup.java b/vault-client/src/main/java/org/talend/sdk/components/vault/client/VaultClientSetup.java index fb16f251cd608..1eea6f2f575db 100644 --- a/vault-client/src/main/java/org/talend/sdk/components/vault/client/VaultClientSetup.java +++ b/vault-client/src/main/java/org/talend/sdk/components/vault/client/VaultClientSetup.java @@ -50,7 +50,6 @@ import javax.ws.rs.client.WebTarget; import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.eclipse.microprofile.opentracing.ClientTracingRegistrar; import org.talend.sdk.components.vault.configuration.Documentation; import lombok.Data; @@ -207,7 +206,7 @@ private ClientBuilder createClient(final ExecutorService executor, final Optiona return null; } }).filter(Objects::nonNull)).ifPresent(it -> it.forEach(builder::register)); - return ClientTracingRegistrar.configure(builder); + return builder; } private SSLContext createUnsafeSSLContext() { diff --git a/vault-client/src/test/java/org/talend/sdk/components/vault/client/VaultClientTest.java b/vault-client/src/test/java/org/talend/sdk/components/vault/client/VaultClientTest.java index fc632cf777b53..1068c0f1f72de 100644 --- a/vault-client/src/test/java/org/talend/sdk/components/vault/client/VaultClientTest.java +++ b/vault-client/src/test/java/org/talend/sdk/components/vault/client/VaultClientTest.java @@ -369,8 +369,6 @@ void executeWithRealVault() { * add to deps : openwebbeans-se */ void testWithStandaloneContainer() { - System.setProperty("geronimo.opentracing.filter.active", "false"); - System.setProperty("geronimo.opentracing.span.converter.zipkin.logger.active", "false"); System.setProperty("talend.vault.cache.vault.auth.roleId", "_role-id_"); System.setProperty("talend.vault.cache.vault.auth.secretId", "_secret-id_"); System.setProperty("talend.vault.cache.vault.url", "http://localhost:8200"); diff --git a/vault-client/src/test/java/org/talend/sdk/components/vault/client/vault/SetMockUrl.java b/vault-client/src/test/java/org/talend/sdk/components/vault/client/vault/SetMockUrl.java index 32750efa08b53..43814702f093f 100644 --- a/vault-client/src/test/java/org/talend/sdk/components/vault/client/vault/SetMockUrl.java +++ b/vault-client/src/test/java/org/talend/sdk/components/vault/client/vault/SetMockUrl.java @@ -16,8 +16,6 @@ package org.talend.sdk.components.vault.client.vault; import org.apache.catalina.startup.Tomcat; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.core.config.Configurator; import org.apache.meecrowave.Meecrowave; import lombok.Setter; @@ -30,8 +28,6 @@ public class SetMockUrl implements Meecrowave.MeecrowaveAwareInstanceCustomizer @Override public void accept(final Tomcat tomcat) { final String hurle = "http://localhost:" + meecrowave.getConfiguration().getHttpPort(); - System.setProperty("geronimo.opentracing.filter.active", "false"); - System.setProperty("geronimo.opentracing.span.converter.zipkin.logger.active", "false"); System.setProperty("talend.vault.cache.vault.url", hurle); System.setProperty("talend.vault.cache.vault.auth.endpoint", "/api/v1/mock/vault/login"); System