Skip to content

Commit

Permalink
Move Prometheus dependency to Prometheus agent only (apache#22950)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Dec 18, 2022
1 parent a27051c commit b906060
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
9 changes: 9 additions & 0 deletions agent/plugins/metrics/type/prometheus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<artifactId>shardingsphere-agent-metrics-prometheus</artifactId>
<name>${project.artifactId}</name>

<properties>
<prometheus.version>0.11.0</prometheus.version>
<prometheus.jmx.version>0.16.1</prometheus.jmx.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
Expand Down Expand Up @@ -55,18 +60,22 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus.jmx</groupId>
<artifactId>collector</artifactId>
<version>${prometheus.jmx.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ private void startServer(final PluginConfiguration pluginConfig, final boolean i
}
}

private void registerCollector(final boolean isEnableCollectJVMInformation, final boolean isEnhancedForProxy) {
private void registerCollector(final boolean isCollectJVMInformation, final boolean isEnhancedForProxy) {
new BuildInfoCollector(isEnhancedForProxy).register();
if (isEnhancedForProxy) {
new ProxyInfoCollector().register();
new MetaDataInfoCollector().register();
}
if (isEnableCollectJVMInformation) {
if (isCollectJVMInformation) {
DefaultExports.initialize();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
/**
* Build information collector.
*/
@Slf4j
@RequiredArgsConstructor
@Slf4j
public final class BuildInfoCollector extends Collector {

private static final String PROXY_BOOTSTRAP_CLASS = "org.apache.shardingsphere.proxy.Bootstrap";
Expand Down
22 changes: 0 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@

<elasticjob.version>3.0.2</elasticjob.version>

<prometheus.version>0.11.0</prometheus.version>
<prometheus.jmx.version>0.16.1</prometheus.jmx.version>
<opentracing.version>0.31.0</opentracing.version>
<jaeger-client.version>0.31.0</jaeger-client.version>
<zipkin-brave.version>5.13.2</zipkin-brave.version>
Expand Down Expand Up @@ -429,26 +427,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus.jmx</groupId>
<artifactId>collector</artifactId>
<version>${prometheus.jmx.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
Expand Down

0 comments on commit b906060

Please sign in to comment.