Skip to content

Commit 5b60de3

Browse files
committed
Fixed issue which is appending "Custom Metrics" to the specified prefix
1 parent 410b1e5 commit 5b60de3

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.appdynamics.extensions</groupId>
88
<artifactId>sql-monitoring-extension</artifactId>
9-
<version>1.3.1</version>
9+
<version>1.3.2</version>
1010
<packaging>jar</packaging>
1111
<name>sql-monitoring-extension</name>
1212
<url>http://maven.apache.org</url>
@@ -155,7 +155,7 @@
155155
includes="${project.artifactId}.${project.packaging}"/>
156156
</copy>
157157
<zip destfile="${target.dir}-${project.version}.zip">
158-
<zipfileset dir="${target.dir}" filemode="755" prefix="SqlMonitor/"/>
158+
<zipfileset dir="${target.dir}" filemode="755" prefix="SQLMonitor/"/>
159159
</zip>
160160
<delete dir="${target.dir}"/>
161161
</target>

src/main/java/com/appdynamics/monitors/sql/SQLMonitor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private String executeCommands(Configuration config, String status) {
9494
int counter = 1;
9595
logger.info("sql statement: " + counter++);
9696
String statement = command.getCommand();
97-
String displayPrefix = server.getDisplayName()+"|"+command.getDisplayPrefix();
97+
String displayPrefix = server.getDisplayName() + "|" + command.getDisplayPrefix();
9898
if (statement != null) {
9999
statement = statement.trim();
100100
// parse into statement and roll up
@@ -136,9 +136,6 @@ private void processMetricPrefix(String metricPrefix) {
136136
if (!metricPrefix.endsWith("|")) {
137137
metricPrefix = metricPrefix + "|";
138138
}
139-
if (!metricPrefix.startsWith("Custom Metrics|")) {
140-
metricPrefix = "Custom Metrics|" + metricPrefix;
141-
}
142139

143140
this.metricPrefix = metricPrefix;
144141
}

src/main/resources/conf/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ servers:
4141

4242
# Make sure the metric prefix ends with a |
4343
#This will create this metric in all the tiers, under this path.
44-
metricPrefix: "Custom Metrics|SQL|"
44+
#metricPrefix: "Custom Metrics|SQL|"
4545
#This will create it in specific Tier. Replace <ComponentID> with TierID
46-
#metricPrefix: "Server|Component:<ComponentID>|Custom Metrics|SQL|"
46+
metricPrefix: "Server|Component:<ComponentID>|Custom Metrics|SQL|"

0 commit comments

Comments
 (0)