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

WIP: chore(engine): remove telemetry code #4465

Closed
wants to merge 8 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<module name="org.camunda.commons.camunda-commons-logging" />
<module name="org.camunda.commons.camunda-commons-utils" />
<module name="org.camunda.commons.camunda-commons-typed-values" export="true" />
<module name="org.camunda.connect.camunda-connect-core" />
<module name="org.camunda.template-engines.camunda-template-engines-freemarker" services="import" />
<module name="org.camunda.spin.camunda-spin-core" services="import"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@

<module name="org.camunda.bpm.camunda-engine-plugins" optional="true" />

<module name="org.camunda.connect.camunda-connect-core" />
<module name="org.camunda.connect.camunda-connect-http-client" services="import" />
<module name="org.camunda.connect.camunda-connect-soap-http-client" services="import" />

<!-- for LDAP plugin only -->
<module name="sun.jdk" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration;
import org.camunda.bpm.container.impl.jboss.config.ManagedProcessEngineMetadata;
import org.camunda.bpm.container.impl.jboss.plugin.JBossConnectProcessEnginePlugin;
import org.camunda.bpm.container.impl.jboss.util.JBossCompatibilityExtension;
import org.camunda.bpm.container.impl.jboss.util.Tccl;
import org.camunda.bpm.container.impl.jboss.util.Tccl.Operation;
Expand Down Expand Up @@ -67,8 +66,6 @@ public class MscManagedProcessEngineController extends MscManagedProcessEngine {

private final static Logger LOGGER = Logger.getLogger(MscManagedProcessEngineController.class.getName());

protected static final String CONNECT_PROCESS_ENGINE_PLUGIN_NAME = "org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin";

protected Supplier<ExecutorService> executorSupplier;

// Providing these values makes the MSC aware of our dependencies on these resources.
Expand Down Expand Up @@ -195,8 +192,6 @@ protected void addProcessEnginePlugins(JakartaTransactionProcessEngineConfigurat
// add process engine plugins:
List<ProcessEnginePluginXml> pluginConfigurations = processEngineMetadata.getPluginConfigurations();

boolean isConnectPluginAdded = false;

for (ProcessEnginePluginXml pluginXml : pluginConfigurations) {
// create plugin instance
ProcessEnginePlugin plugin = null;
Expand All @@ -214,15 +209,8 @@ protected void addProcessEnginePlugins(JakartaTransactionProcessEngineConfigurat
// add to configuration
processEngineConfiguration.getProcessEnginePlugins().add(plugin);

if(pluginClassName.equals(CONNECT_PROCESS_ENGINE_PLUGIN_NAME)) {
isConnectPluginAdded = true;
}
}

// add connect plugin to load connectors
if (!isConnectPluginAdded) {
processEngineConfiguration.getProcessEnginePlugins().add(new JBossConnectProcessEnginePlugin());
}
}

protected JakartaTransactionProcessEngineConfiguration createProcessEngineConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<module name="org.camunda.commons.camunda-commons-logging" />
<module name="org.camunda.commons.camunda-commons-utils" />
<module name="org.camunda.commons.camunda-commons-typed-values" export="true" />
<module name="org.camunda.connect.camunda-connect-core" />
<module name="org.camunda.template-engines.camunda-template-engines-freemarker" services="import" />
<module name="org.camunda.spin.camunda-spin-core" services="import"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@

<module name="org.camunda.bpm.camunda-engine-plugins" optional="true" />

<module name="org.camunda.connect.camunda-connect-core" />
<module name="org.camunda.connect.camunda-connect-http-client" services="import" />
<module name="org.camunda.connect.camunda-connect-soap-http-client" services="import" />

<!-- for LDAP plugin only -->
<module name="sun.jdk" />

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import org.camunda.bpm.container.impl.jboss.config.ManagedJtaProcessEngineConfiguration;
import org.camunda.bpm.container.impl.jboss.config.ManagedProcessEngineMetadata;
import org.camunda.bpm.container.impl.jboss.plugin.JBossConnectProcessEnginePlugin;
import org.camunda.bpm.container.impl.jboss.util.JBossCompatibilityExtension;
import org.camunda.bpm.container.impl.jboss.util.Tccl;
import org.camunda.bpm.container.impl.jboss.util.Tccl.Operation;
Expand Down Expand Up @@ -64,7 +63,6 @@ public class MscManagedProcessEngineController extends MscManagedProcessEngine {

private final static Logger LOGGER = Logger.getLogger(MscManagedProcessEngineController.class.getName());

protected static final String CONNECT_PROCESS_ENGINE_PLUGIN_NAME = "org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin";

protected InjectedValue<ExecutorService> executorInjector = new InjectedValue<ExecutorService>();

Expand Down Expand Up @@ -185,8 +183,6 @@ protected void addProcessEnginePlugins(JtaProcessEngineConfiguration processEngi
// add process engine plugins:
List<ProcessEnginePluginXml> pluginConfigurations = processEngineMetadata.getPluginConfigurations();

boolean isConnectPluginAdded = false;

for (ProcessEnginePluginXml pluginXml : pluginConfigurations) {
// create plugin instance
ProcessEnginePlugin plugin = null;
Expand All @@ -203,16 +199,8 @@ protected void addProcessEnginePlugins(JtaProcessEngineConfiguration processEngi

// add to configuration
processEngineConfiguration.getProcessEnginePlugins().add(plugin);

if(pluginClassName.equals(CONNECT_PROCESS_ENGINE_PLUGIN_NAME)) {
isConnectPluginAdded = true;
}
}

// add connect plugin to load connectors
if (!isConnectPluginAdded) {
processEngineConfiguration.getProcessEnginePlugins().add(new JBossConnectProcessEnginePlugin());
}
}

protected JtaProcessEngineConfiguration createProcessEngineConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {

addConnectorParseListener(processEngineConfiguration);

processEngineConfiguration.setTelemetryHttpConnector(Connectors.getConnector(Connectors.HTTP_CONNECTOR_ID));
}

private void addConnectorParseListener(ProcessEngineConfigurationImpl processEngineConfiguration) {
Expand Down
42 changes: 7 additions & 35 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,6 @@
<artifactId>gson</artifactId>
</dependency>

<dependency>
<groupId>org.camunda.connect</groupId>
<artifactId>camunda-connect-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.camunda.connect</groupId>
<artifactId>camunda-connect-connectors-all</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.camunda.connect</groupId>
<artifactId>camunda-connect-http-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.camunda.connect</groupId>
<artifactId>camunda-connect-soap-http-client</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>

<!-- provided dependencies -->

<dependency>
Expand Down Expand Up @@ -300,12 +277,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
Expand Down Expand Up @@ -342,6 +313,13 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.2-jre</version>
<scope>test</scope>
</dependency>
</dependencies>


Expand Down Expand Up @@ -484,20 +462,14 @@
<exclude>org.camunda.bpm.dmn:*</exclude>
<exclude>org.camunda.bpm.juel:*</exclude>
<exclude>org.camunda.commons:*</exclude>
<exclude>org.camunda.connect:*</exclude>
<exclude>org.camunda.feel:*</exclude>

<exclude>org.springframework:*</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>org.apache.commons:*</exclude>
<exclude>com.sun.mail:*</exclude>
<exclude>javax.activation:*</exclude>
<exclude>org.mybatis:mybatis:*</exclude>
<exclude>commons-logging:*</exclude>
<exclude>joda-time:*</exclude>
<exclude>org.apache.httpcomponents:httpclient</exclude>
<exclude>org.apache.httpcomponents:httpcore</exclude>
<exclude>commons-codec:commons-codec</exclude>
</excludes>
</artifactSet>
<relocations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.camunda.bpm.engine.impl.telemetry.dto.TelemetryDataImpl;
import org.camunda.bpm.engine.impl.telemetry.dto.LicenseKeyDataImpl;
import org.camunda.bpm.engine.impl.telemetry.reporter.TelemetryReporter;
import org.camunda.bpm.engine.impl.util.TelemetryUtil;

/**
* @author Nikola Koevski
Expand All @@ -57,7 +56,6 @@ public Void execute(CommandContext commandContext) {
createHistoryCleanupJob(commandContext);
}

initializeTelemetryProperty(commandContext);
// installationId needs to be updated in the telemetry data
updateTelemetryData(commandContext);
startTelemetryReporter(commandContext);
Expand Down Expand Up @@ -105,61 +103,6 @@ protected boolean isHistoryCleanupEnabled(CommandContext commandContext) {
.isHistoryCleanupEnabled();
}

public void initializeTelemetryProperty(CommandContext commandContext) {
try {

checkTelemetryLockExists(commandContext);

acquireExclusiveTelemetryLock(commandContext);
PropertyEntity databaseTelemetryProperty = databaseTelemetryConfiguration(commandContext);

ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
if (databaseTelemetryProperty == null) {
LOG.noTelemetryPropertyFound();
createTelemetryProperty(commandContext);
}

// reset collected dynamic data
if ((databaseTelemetryProperty == null && processEngineConfiguration.isInitializeTelemetry())
|| (databaseTelemetryProperty != null && Boolean.parseBoolean(databaseTelemetryProperty.getValue()))) {
TelemetryUtil.toggleLocalTelemetry(true,
processEngineConfiguration.getTelemetryRegistry(),
processEngineConfiguration.getMetricsRegistry());
}

} catch (Exception e) {
LOG.errorConfiguringTelemetryProperty(e);
}
}

protected void checkTelemetryLockExists(CommandContext commandContext) {
PropertyEntity telemetryLockProperty = commandContext.getPropertyManager().findPropertyById("telemetry.lock");
if (telemetryLockProperty == null) {
LOG.noTelemetryLockPropertyFound();
}
}

protected PropertyEntity databaseTelemetryConfiguration(CommandContext commandContext) {
try {
return commandContext.getPropertyManager().findPropertyById(TELEMETRY_PROPERTY_NAME);
} catch (Exception e) {
LOG.errorFetchingTelemetryPropertyInDatabase(e);
return null;
}
}

protected void createTelemetryProperty(CommandContext commandContext) {
Boolean telemetryEnabled = commandContext.getProcessEngineConfiguration().isInitializeTelemetry();
PropertyEntity property = null;
if (telemetryEnabled != null) {
property = new PropertyEntity(TELEMETRY_PROPERTY_NAME, Boolean.toString(telemetryEnabled));
} else {
property = new PropertyEntity(TELEMETRY_PROPERTY_NAME, "null");
}
commandContext.getPropertyManager().insert(property);
LOG.creatingTelemetryPropertyInDatabase(telemetryEnabled);
}

public void initializeInstallationId(CommandContext commandContext) {
checkInstallationIdLockExists(commandContext);

Expand Down Expand Up @@ -244,12 +187,6 @@ protected void startTelemetryReporter(CommandContext commandContext) {
}
}

protected void acquireExclusiveTelemetryLock(CommandContext commandContext) {
PropertyManager propertyManager = commandContext.getPropertyManager();
//exclusive lock
propertyManager.acquireExclusiveLockForTelemetry();
}

protected void acquireExclusiveInstallationIdLock(CommandContext commandContext) {
PropertyManager propertyManager = commandContext.getPropertyManager();
//exclusive lock
Expand Down
Loading