Skip to content

Commit fec67eb

Browse files
committed
remove jackson-databind-yaml, other transitive dependecies, obsolete classes and update tests
1 parent 68f2d5e commit fec67eb

29 files changed

+1587
-496
lines changed

.teamcity/AE_ElasticsearchMonitoringExtension/Extensions.kt

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension
172

183
import AE_ElasticsearchMonitoringExtension.vcsRoots.AE_ElasticsearchMonitoringExtension
194
import jetbrains.buildServer.configs.kotlin.v2018_2.BuildType
205
import jetbrains.buildServer.configs.kotlin.v2018_2.VcsRoot
216
import jetbrains.buildServer.configs.kotlin.v2018_2.buildFeatures.commitStatusPublisher
7+
import jetbrains.buildServer.configs.kotlin.v2018_2.triggers.finishBuildTrigger
8+
import jetbrains.buildServer.configs.kotlin.v2018_2.BuildTypeSettings
229

2310
fun BuildType.publishCommitStatus() {
2411
features {
@@ -43,3 +30,13 @@ fun BuildType.withDefaults() {
4330
matches("env.AGENT_OS", "Linux")
4431
}
4532
}
33+
34+
fun BuildTypeSettings.triggerAfter(buildJob: BuildTypeSettings, branches: String = "+:master") {
35+
triggers {
36+
finishBuildTrigger {
37+
buildType = "${buildJob.id}"
38+
successfulOnly = true
39+
branchFilter = branches
40+
}
41+
}
42+
}

.teamcity/AE_ElasticsearchMonitoringExtension/Project.kt

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension
172

183
import AE_ElasticsearchMonitoringExtension.buildTypes.*

.teamcity/AE_ElasticsearchMonitoringExtension/buildTypes/AE_ElasticsearchMonitoringExtension_Build.kt

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension.buildTypes
172

183
import AE_ElasticsearchMonitoringExtension.publishCommitStatus
@@ -21,6 +6,7 @@ import AE_ElasticsearchMonitoringExtension.withDefaults
216
import jetbrains.buildServer.configs.kotlin.v2018_2.BuildType
227
import jetbrains.buildServer.configs.kotlin.v2018_2.buildSteps.maven
238
import jetbrains.buildServer.configs.kotlin.v2018_2.triggers.vcs
9+
import jetbrains.buildServer.configs.kotlin.v2018_2.triggers.schedule
2410

2511
object AE_ElasticsearchMonitoringExtension_Build : BuildType({
2612
uuid = "7347eee0-b25b-422a-9843-3fc233d79a63"
@@ -33,12 +19,23 @@ object AE_ElasticsearchMonitoringExtension_Build : BuildType({
3319
goals = "clean install"
3420
mavenVersion = defaultProvidedVersion()
3521
jdkHome = "%env.JDK_18%"
22+
userSettingsSelection = "teamcity-settings"
3623
}
3724
}
3825

3926
triggers {
4027
vcs {
4128
}
29+
schedule {
30+
schedulingPolicy = cron {
31+
hours = "4"
32+
}
33+
branchFilter = "+:master"
34+
triggerBuild = always()
35+
withPendingChangesOnly = false
36+
param("revisionRule", "lastFinished")
37+
param("dayOfWeek", "SUN-SAT")
38+
}
4239
}
4340

4441
artifactRules = """

.teamcity/AE_ElasticsearchMonitoringExtension/buildTypes/AE_ElasticsearchMonitoringExtension_IntegrationTests.kt

+7-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension.buildTypes
172

183
import AE_ElasticsearchMonitoringExtension.publishCommitStatus
4+
import AE_ExtensionStarter.triggerAfter
195
import AE_ElasticsearchMonitoringExtension.vcsRoots.AE_ElasticsearchMonitoringExtension
206
import AE_ElasticsearchMonitoringExtension.withDefaults
217
import jetbrains.buildServer.configs.kotlin.v2018_2.BuildStep
@@ -57,6 +43,10 @@ object AE_ElasticsearchMonitoringExtension_IntegrationTests : BuildType({
5743
}
5844
}
5945

46+
artifactRules = """
47+
/opt/buildAgent/work/machine-agent-logs => target/
48+
""".trimIndent()
49+
6050
dependencies {
6151
dependency(AE_ElasticsearchMonitoringExtension_Build) {
6252
snapshot {
@@ -71,4 +61,6 @@ object AE_ElasticsearchMonitoringExtension_IntegrationTests : BuildType({
7161
}
7262

7363
publishCommitStatus()
64+
65+
triggerAfter(AE_ExtensionStarter_Build)
7466
})

.teamcity/AE_ElasticsearchMonitoringExtension/buildTypes/AE_ElasticsearchMonitoringExtension_WorkbenchTest.kt

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension.buildTypes
172

183
import AE_ElasticsearchMonitoringExtension.publishCommitStatus
4+
import AE_ExtensionStarter.triggerAfter
195
import AE_ElasticsearchMonitoringExtension.vcsRoots.AE_ElasticsearchMonitoringExtension
206
import AE_ElasticsearchMonitoringExtension.withDefaults
217
import jetbrains.buildServer.configs.kotlin.v2018_2.BuildStep
@@ -62,4 +48,6 @@ object AE_ElasticsearchMonitoringExtension_WorkbenchTest : BuildType({
6248
}
6349

6450
publishCommitStatus()
51+
52+
triggerAfter(AE_ExtensionStarter_Build)
6553
})
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
~ Copyright (c) 2020 AppDynamics,Inc.
4-
~ Licensed under the Apache License, Version 2.0 (the "License");
5-
~ you may not use this file except in compliance with the License.
6-
~ You may obtain a copy of the License at
7-
~
8-
~ http://www.apache.org/licenses/LICENSE-2.0
9-
~
10-
~ Unless required by applicable law or agreed to in writing, software
11-
~ distributed under the License is distributed on an "AS IS" BASIS,
12-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
~ See the License for the specific language governing permissions and
14-
~ limitations under the License.
15-
-->
162

173
<settings />
184

.teamcity/AE_ElasticsearchMonitoringExtension/vcsRoots/AE_ElasticsearchMonitoringExtension.kt

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright (c) 2019 AppDynamics,Inc.
3-
* Licensed under the Apache License, Version 2.0 (the "License");
4-
* you may not use this file except in compliance with the License.
5-
* You may obtain a copy of the License at
6-
*
7-
* http://www.apache.org/licenses/LICENSE-2.0
8-
*
9-
* Unless required by applicable law or agreed to in writing, software
10-
* distributed under the License is distributed on an "AS IS" BASIS,
11-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
* See the License for the specific language governing permissions and
13-
* limitations under the License.
14-
*/
15-
161
package AE_ElasticsearchMonitoringExtension.vcsRoots
172

183
import jetbrains.buildServer.configs.kotlin.v2018_2.vcs.GitVcsRoot

Dockerfile_MA

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:latest
22
RUN apk add --no-cache openjdk8
33
WORKDIR /opt/appdynamics/machine-agent
4-
COPY --from=dtr.corp.appdynamics.com/appdynamics/machine-agent /opt/appdynamics/machine-agent .
4+
COPY --from=dtr.corp.appdynamics.com/appdynamics/machine-agent:latest /opt/appdynamics/machine-agent .
55
COPY target/ElasticsearchMonitor-*.zip monitors/ElasticsearchMonitor.zip
66
RUN unzip -q monitors/ElasticsearchMonitor.zip -d monitors/ && \
77
rm monitors/ElasticsearchMonitor.zip

Dockerfile_WorkBench

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM alpine:latest
22
RUN apk add --no-cache openjdk8
33
RUN apk add --no-cache curl
44
WORKDIR /opt/appdynamics/machine-agent
5-
COPY --from=dtr.corp.appdynamics.com/appdynamics/machine-agent /opt/appdynamics/machine-agent .
5+
COPY --from=dtr.corp.appdynamics.com/appdynamics/machine-agent:latest /opt/appdynamics/machine-agent .
66
WORKDIR /opt/appdynamics/machine-agent/monitors
77
COPY target/ElasticsearchMonitor-*.zip ElasticsearchMonitor.zip
88
RUN unzip -q ElasticsearchMonitor.zip && \

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019 AppDynamics LLC and its affiliates
1+
Copyright 2020 AppDynamics LLC and its affiliates
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

Makefile

-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
docker-clean:
2-
@echo deleting containers
3-
docker rm `docker ps -q -f status=exited`
4-
@echo "Delete all untagged/dangling (<none>) images"
5-
# remove untagged or all images
6-
docker rmi `docker images -q -f dangling=true`
7-
81
dockerRun:
92
@echo "------- Starting elasticsearch cluster -------"
103
docker-compose up -d --force-recreate elasticsearch elasticsearch2
@@ -14,12 +7,6 @@ dockerRun:
147
# wait until it installs controller and ES
158
sleep 600
169
@echo "------- Controller started -------"
17-
# uncomment docker exec and sleep lines to enable port 9200
18-
# bash into the controller controller, change props to enable port 9200
19-
# docker exec controller /bin/bash -c "sed -i s/ad.es.node.http.enabled=false/ad.es.node.http.enabled=true/g events-service/processor/conf/events-service-api-store.properties"
20-
# restart ES to make the changes reflect
21-
# docker exec controller /bin/bash -c "pa/platform-admin/bin/platform-admin.sh submit-job --platform-name AppDynamicsPlatform --service events-service --job restart-cluster"
22-
# sleep 60
2310
@echo ------- Starting machine agent -------
2411
docker-compose up --force-recreate -d --build machine
2512
@echo ------- Machine agent started -------

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ services:
4747
- APPDYNAMICS_CONTROLLER_SSL_ENABLED=false
4848
- APPDYNAMICS_CONTROLLER_PORT=8080
4949
- EVENTS_SERVICE_HOST=controller
50-
- MACHINE_AGENT_PROPERTIES=-Dappdynamics.sim.enabled=true -Dappdynamics.docker.enabled=false
50+
- MACHINE_AGENT_PROPERTIES=-Dappdynamics.sim.enabled=true -Dappdynamics.docker.enabled=false -Dappdynamics.controller.port=8080
5151
build:
5252
context: .
5353
dockerfile: Dockerfile_MA

pom.xml

+2-35
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<target.name>ElasticsearchMonitor</target.name>
1717
<target.dir>${project.build.directory}/${target.name}</target.dir>
1818
<skipITs>true</skipITs>
19-
<kotlin.version>1.2.71</kotlin.version>
2019
</properties>
2120

2221
<dependencies>
@@ -29,40 +28,7 @@
2928
<dependency>
3029
<groupId>com.appdynamics</groupId>
3130
<artifactId>appd-exts-commons</artifactId>
32-
<version>2.2.1</version>
33-
</dependency>
34-
<dependency>
35-
<groupId>log4j</groupId>
36-
<artifactId>log4j</artifactId>
37-
<version>1.2.17</version>
38-
<scope>provided</scope>
39-
</dependency>
40-
<dependency>
41-
<groupId>com.fasterxml.jackson.dataformat</groupId>
42-
<artifactId>jackson-dataformat-yaml</artifactId>
43-
<version>2.9.9</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>com.fasterxml.jackson.core</groupId>
47-
<artifactId>jackson-databind</artifactId>
48-
<version>2.9.9.3</version>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.slf4j</groupId>
52-
<artifactId>slf4j-log4j12</artifactId>
53-
<version>1.7.21</version>
54-
<scope>test</scope>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.jetbrains.kotlin</groupId>
58-
<artifactId>kotlin-stdlib-jdk8</artifactId>
59-
<version>${kotlin.version}</version>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.jetbrains.kotlin</groupId>
63-
<artifactId>kotlin-test</artifactId>
64-
<version>${kotlin.version}</version>
65-
<scope>test</scope>
31+
<version>2.2.3</version>
6632
</dependency>
6733
<dependency>
6834
<groupId>junit</groupId>
@@ -152,6 +118,7 @@
152118
<copy todir="${target.dir}">
153119
<fileset dir="src/main/resources/conf" includes="monitor.xml"/>
154120
<fileset dir="src/main/resources/conf" includes="config.yml"/>
121+
<fileset dir="src/main/resources/conf" includes="ElasticsearchDashboard.json"/>
155122
<fileset dir="${project.basedir}" includes="LICENSE.txt,NOTICE.txt"/>
156123
<fileset dir="${project.build.directory}"
157124
includes="${project.artifactId}.${project.packaging}"/>

src/integration-test/java/com/appdynamics/extensions/elasticsearch/MetricCheckIT.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.appdynamics.extensions.controller.apiservices.MetricAPIService;
2020
import com.appdynamics.extensions.util.JsonUtils;
2121
import org.apache.commons.lang3.StringUtils;
22-
import org.codehaus.jackson.JsonNode;
22+
import com.fasterxml.jackson.databind.JsonNode;
2323
import org.junit.Assert;
2424
import org.junit.Before;
2525
import org.junit.Test;
@@ -33,7 +33,6 @@
3333
import static org.hamcrest.CoreMatchers.notNullValue;
3434
import static org.junit.Assert.assertThat;
3535

36-
3736
public class MetricCheckIT {
3837
private MetricAPIService metricAPIService;
3938
private CustomDashboardAPIService customDashboardAPIService;

src/integration-test/resources/conf/ElasticsearchBTDDashboard.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"displayName": "null",
7777
"inputMetricText": false,
7878
"inputMetricPath": null,
79-
"relativeMetricPath": "Custom Metrics|Elasticsearch|Server1|HeartBeat"
79+
"relativeMetricPath": "Custom Metrics|*|*|HeartBeat"
8080
},
8181
"rollupMetricData": false,
8282
"expressionString": null,
@@ -109,4 +109,4 @@
109109
],
110110
"template": false,
111111
"warRoom": false
112-
}
112+
}

src/integration-test/resources/conf/config.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,10 @@ controllerInfo:
348348
tierName: ""
349349
nodeName: ""
350350

351+
enableHealthChecks: false
352+
351353
encryptionKey: ""
352354

353-
# numberOfThreads = number of servers + cat endpoints configured
354-
# for example if there are 7 cat endpoints for one server then numberOfThreads = 1 + 7 = 8
355+
# numberOfThreads = number of servers * (1 + cat endpoints configured)
356+
# for example if there are 7 cat endpoints for one server then numberOfThreads = 1 * (1 + 7) = 8
355357
numberOfThreads: 8

0 commit comments

Comments
 (0)