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

SC-12737 Reverted to stagger changes to agent package #129

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a192ca1
Delete spm-tracing modules
PabloB94 Apr 13, 2022
d888f60
Remove spm-tracing modules from top pom file
PabloB94 Apr 13, 2022
9d0c1d9
Remove spm-tracing modules from children pom files
PabloB94 Apr 13, 2022
4e21c3b
Remove spm-tracing references and Handler class
PabloB94 Apr 13, 2022
0d1eac0
Remove tracing from spm-monitor
PabloB94 Apr 13, 2022
bf88005
Remove tracing from Instrumentation Settings Handler
PabloB94 Apr 13, 2022
c08a4de
Remove ThriftUtils from Instrumentation Settings Handler
PabloB94 Apr 13, 2022
37105a9
Remove ThriftUtils from Command Handlers
PabloB94 Apr 13, 2022
f677b33
Remove missing variable
PabloB94 Apr 13, 2022
4524dcc
Remove tracing references from Stat Collector
PabloB94 Apr 19, 2022
6e4e1d9
Add full stack traces to maven errors
PabloB94 Apr 19, 2022
4ebec7c
Pom updates
PabloB94 Apr 27, 2022
50c1543
Rearrange configuration and execution definitions for assembly plugin
PabloB94 Apr 28, 2022
34b505e
Add assembly configuration descriptor and remove more tracing references
PabloB94 Apr 28, 2022
e51dbd6
Remove tracing references from Storm module
PabloB94 Apr 28, 2022
6d79cde
Update all references of log4j to 2.17.2
PabloB94 May 3, 2022
cada8f8
Add Thrift Utils to spm-monitor-utils
PabloB94 May 13, 2022
8cee376
Upgrade log4j version in missing places
PabloB94 May 16, 2022
294e833
Add back ThriftUtils to Instrumentation Settings Handler
PabloB94 May 24, 2022
f91d0b7
Merge remote-tracking branch 'origin/SC-12737' into SC-12737
PabloB94 May 24, 2022
66e041d
Merge pull request #125 from sematext/SC-12737
PabloB94 May 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ podRetention: never()) {
container('maven') {
sh """
cd sematext-agent-java
mvn --batch-mode clean install -DskipTests
mvn --batch-mode clean install -DskipTests -e
"""
}
}
Expand Down
15 changes: 6 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compile.source>1.6</maven.compile.source>
<maven.compile.target>1.6</maven.compile.target>
<maven.compile.test.source>1.6</maven.compile.test.source>
<maven.compile.test.target>1.6</maven.compile.test.target>
<maven.compile.source>1.8</maven.compile.source>
<maven.compile.target>1.8</maven.compile.target>
<maven.compile.test.source>1.8</maven.compile.test.source>
<maven.compile.test.target>1.8</maven.compile.test.target>
<commons-logging.version>1.1.1</commons-logging.version>
<junit.version>4.13.1</junit.version>
<log4j.version>2.17.1</log4j.version>
<log4j.version>2.17.2</log4j.version>
<dockerfile.version>1.4.7</dockerfile.version>
<checkstyle.config.location>checkstyle.xml</checkstyle.config.location>
</properties>
Expand Down Expand Up @@ -118,9 +118,6 @@
<module>spm-transfer</module>
<module>spm-monitor-redis</module>
<module>spm-monitor-storm</module>
<module>spm-tracing-agent</module>
<module>spm-tracing-testing</module>
<module>spm-tracing-agent-impl</module>
<module>spm-monitor-haproxy</module>
</modules>

Expand All @@ -135,7 +132,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
24 changes: 1 addition & 23 deletions spm-client-common-libs-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

<properties>
<common.lib.scope>provided</common.lib.scope>
<tracing.agent.lib.scope>compile</tracing.agent.lib.scope>
<tracing.agent.impl.lib.scope>compile</tracing.agent.impl.lib.scope>
<sender.lib.scope>compile</sender.lib.scope>
</properties>

Expand All @@ -35,26 +33,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.sematext.spm</groupId>
<artifactId>spm-tracing-agent</artifactId>
<version>${project.version}</version>
<scope>${tracing.agent.lib.scope}</scope>
</dependency>

<dependency>
<groupId>com.sematext.spm</groupId>
<artifactId>spm-tracing-agent-impl</artifactId>
<version>${project.version}</version>
<scope>${tracing.agent.impl.lib.scope}</scope>
<exclusions>
<exclusion>
<groupId>com.sematext.spm</groupId>
<artifactId>spm-thrift-data</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.sematext.spm</groupId>
<artifactId>spm-monitor-utils</artifactId>
Expand Down Expand Up @@ -314,7 +292,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 1 addition & 3 deletions spm-client-common-libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

<properties>
<common.lib.scope>compile</common.lib.scope>
<tracing.agent.lib.scope>provided</tracing.agent.lib.scope>
<tracing.agent.impl.lib.scope>provided</tracing.agent.impl.lib.scope>
<sender.lib.scope>provided</sender.lib.scope>
</properties>

Expand All @@ -25,7 +23,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spm-monitor-generic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,17 @@
import com.sematext.spm.client.jvm.JvmNotifBasedGcStatsCollector;
import com.sematext.spm.client.observation.AttributeObservation;
import com.sematext.spm.client.observation.ObservationBean;
import com.sematext.spm.client.tracing.TracingMonitorConfigurator;
import com.sematext.spm.client.util.CollectionUtils.FunctionT;
import com.sematext.spm.client.yaml.YamlConfigLoader;

public class GenericStatsCollectorsFactory extends StatsCollectorsFactory<StatsCollector<?>> {
private static final Log LOG = LogFactory.getLog(GenericStatsCollectorsFactory.class);
private final TracingMonitorConfigurator tracingConf = new TracingMonitorConfigurator();

public static final Cache<String, StatsCollector<?>> EXISTING_COLLECTORS_MAP = CacheBuilder.newBuilder()
.maximumSize(300000)
.expireAfterAccess(30, TimeUnit.MINUTES)
.build();

private static final int MAX_PCTLS_DEFINITIONS = 10;
private static int CURRENT_COUNT_PCTLS_DEFINITIONS = 0;

Expand Down Expand Up @@ -126,23 +124,6 @@ public Collection<? extends StatsCollector<?>> create(Properties monitorProperti
.getProperty("SPM_MONITOR_SEND_JVM_NAME", "false")
.trim()).trim()));

if (MonitorUtil.MONITOR_RUNTIME_SETUP_JAVAAGENT.get()) {
boolean tracingEnabled = "true".equalsIgnoreCase(MonitorUtil.stripQuotes(monitorProperties
.getProperty("SPM_MONITOR_TRACING_ENABLED", "false")
.trim()).trim());

if (tracingEnabled) {
try {
// always configure, it collects only if right settings are present though (handles it internally)
tracingConf
.configure(monitorConfig, currentCollectors, collectors, Serializer.INFLUX, appToken, subType, jvmName);
} catch (Throwable thr) {
// don't propagate, just continue
LOG.error("Error while configuring tracing conf", thr);
}
}
}

CURRENT_COUNT_PCTLS_DEFINITIONS = 0;

LOG.info("Loading configs for collectors: " + types);
Expand All @@ -167,7 +148,7 @@ public JvmNotifBasedGcStatsCollector apply(String id) {
}

collectors = groupCollectorsByTags(collectors, monitorConfig);

// as last collector add HeartbeatCollector
updateCollector(currentCollectors, collectors, HeartbeatStatsCollector.class, jvmName,
new FunctionT<String, HeartbeatStatsCollector, StatsCollectorBadConfigurationException>() {
Expand All @@ -176,7 +157,7 @@ public HeartbeatStatsCollector apply(String id) {
return new HeartbeatStatsCollector(Serializer.INFLUX, appToken, jvmName, subType);
}
});

int collectorsCount = StatsCollector.getCollectorsCount(collectors);
if (collectorsCount < 50) {
LOG.info("Created " + collectors.size() + " collectors : " + collectors);
Expand Down Expand Up @@ -657,7 +638,7 @@ private StatsExtractorConfig<?> getStatsExtractorConfig(File configFile, String

// replace all monitor properties placeholders with real values from properties file
// NOTE: assumption is that it is ok if behavior will be undefined when two props have the same variants (ST_PROP
// and SPM_PROP) because order of execution would affect the end result
// and SPM_PROP) because order of execution would affect the end result
for (Object property : monitorProperties.keySet()) {
String propertyValue = MonitorUtil.stripQuotes(monitorProperties.getProperty(String.valueOf(property), "").trim())
.trim();
Expand Down Expand Up @@ -791,7 +772,7 @@ private List<StatsCollector<?>> groupCollectorsByTags(List<StatsCollector<?>> co
}
}

// check if everything resolved too
// check if everything resolved too
if (!col.getGenericExtractor().isAllConfigTagsResolved()) {
nonGroupableCollectors.add(sc);
} else {
Expand Down
2 changes: 1 addition & 1 deletion spm-monitor-haproxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
46 changes: 17 additions & 29 deletions spm-monitor-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -59,7 +59,6 @@
<artifactSet>
<excludes>
<exclude>com.sematext.spm:spm-monitor-utils</exclude>
<exclude>com.sematext.spm:spm-tracing-agent</exclude>
<exclude>com.sematext.spm:spm-monitor-starter</exclude>
<exclude>org.javassist:javassist</exclude>
<exclude>org.eclipse.collections:eclipse-collections-api</exclude>
Expand All @@ -86,14 +85,13 @@
<artifactSet>
<includes>
<include>com.sematext.spm:spm-monitor-utils</include>
<include>com.sematext.spm:spm-tracing-agent</include>
<include>com.sematext.spm:spm-monitor-starter</include>
<include>org.javassist:javassist</include>
</includes>
<excludes>
<exclude>org.eclipse.collections:eclipse-collections-api</exclude>
<exclude>org.eclipse.collections:eclipse-collections</exclude>
<exclude>com.sematext.spm:${artifactId}</exclude>
<exclude>com.sematext.spm:${project.artifactId}</exclude>
<exclude>org.apache.thrift:libthrift</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.slf4j:slf4j-log4j12</exclude>
Expand All @@ -102,15 +100,6 @@
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>com.sematext.spm:spm-tracing-agent</artifact>
<excludes>
<exclude>org/**</exclude>
<exclude>com/sematext/spm/client/tracing/thrift/**</exclude>
<exclude>com/sematext/spm/client/monitor/thrift/**</exclude>
<exclude>com/sematext/spm/client/snap/**</exclude>
</excludes>
</filter>
<filter>
<artifact>com.sematext.spm:spm-monitor-utils</artifact>
<excludes>
Expand All @@ -134,29 +123,28 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptors>
<descriptor>/../spm-monitor-parent/src/main/assembly/dist.xml</descriptor>
</descriptors>
<archive>
<manifestEntries>
<Premain-Class>com.sematext.spm.client.MonitorAgentWrapper</Premain-Class>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
<!-- these are from old sender jar -->
<Specification-Version>${project.version}</Specification-Version>
<mode>development</mode>
<url>${project.url}</url>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<id>create-distro</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>/../spm-monitor-parent/src/main/assembly/monitor-with-tracing-agent-dist.xml</descriptor>
</descriptors>
<archive>
<manifestEntries>
<Premain-Class>com.sematext.spm.client.MonitorAgentWrapper</Premain-Class>
<Can-Retransform-Classes>true</Can-Retransform-Classes>

<!-- these are from old sender jar -->
<Specification-Version>${project.version}</Specification-Version>
<mode>development</mode>
<url>${project.url}</url>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion spm-monitor-parent/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<outputDirectory>monitor-libs</outputDirectory>

<includes>
<include>com.sematext.spm:${artifactId}</include>
<include>com.sematext.spm:${project.artifactId}</include>
</includes>
</dependencySet>
</dependencySets>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion spm-monitor-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spm-monitor-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 1 addition & 3 deletions spm-monitor-storm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -116,8 +116,6 @@
<artifactSet>
<excludes>
<exclude>com.sematext.spm:spm-monitor-utils</exclude>
<exclude>com.sematext.spm:spm-tracing-agent</exclude>
<exclude>com.sematext.spm:spm-tracing-agent-impl</exclude>
<exclude>com.sematext.spm:spm-monitor-starter</exclude>
<exclude>org.javassist:javassist</exclude>
<exclude>org.eclipse.collections:eclipse-collections-api</exclude>
Expand Down
Loading