Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(TCOMP-2578): remove geronimo-opentracing from component-server #827

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ public Dependencies getDependencies(final String[] ids) {
final ComponentFamilyMeta.BaseMeta<Lifecycle> 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());
}

Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ void validateSchemaBuilderOKs() {
}

class MySchema implements Schema {

@Override
public Builder toBuilder() {
return null;
}

@Override
public Type getType() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 0 additions & 21 deletions images/component-server-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,6 @@
<version>${geronimo-metrics.version}</version>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>${opentracing.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile-opentracing.version}</version>
<exclusions>
<exclusion>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo-opentracing.version}</version>
</dependency>
<!-- ecs logging layout -->
<dependency>
<groupId>org.talend.daikon</groupId>
Expand Down
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,10 @@
<asciidoctorj-pdf.version>1.6.0</asciidoctorj-pdf.version>
<microprofile-config-api.version>1.3</microprofile-config-api.version>
<microprofile-openapi-api.version>1.1.1</microprofile-openapi-api.version>
<microprofile-opentracing.version>1.2.1</microprofile-opentracing.version>
<microprofile-metrics-api.version>1.1.1</microprofile-metrics-api.version>
<geronimo-microprofile.version>1.0.2</geronimo-microprofile.version>
<opentracing.version>0.31.0</opentracing.version>
<geronimo-openapi.version>1.0.12</geronimo-openapi.version>
<geronimo-metrics.version>1.0.3</geronimo-metrics.version>
<geronimo-opentracing.version>1.0.2</geronimo-opentracing.version>
<geronimo-config.version>1.2.2</geronimo-config.version>
<junit5.version>5.10.0</junit5.version>
<mockito4.version>4.8.1</mockito4.version>
Expand Down
21 changes: 0 additions & 21 deletions vault-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,6 @@
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
<version>${opentracing.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile-opentracing.version}</version>
<exclusions>
<exclusion>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo-opentracing.version}</version>
</dependency>
<!-- specific deps -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down