Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ojdbc8.jar
pom.xml.releaseBackup
release.properties
release.properties
target/*
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM openjdk:8-jre-alpine

ADD target/prometheus-jdbc-exporter-jar-with-dependencies.jar target/
COPY target/prometheus-jdbc-exporter-jar-with-dependencies.jar /target/
COPY jar_lib/README.md /jar_lib/README.md

EXPOSE 5555

CMD java -Djava.security.egd=file:///dev/urandom -cp "target/*" no.sysco.middleware.metrics.prometheus.jdbc.WebServer 0.0.0.0:5555 ./config.yml
CMD java -Djava.security.egd=file:///dev/urandom -cp "/target/*:/jar_lib/*" no.sysco.middleware.metrics.prometheus.jdbc.WebServer 0.0.0.0:5555 ./config.yml
3 changes: 3 additions & 0 deletions jar_lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Place any addtional jar here. These will be copied into docker image and will be added to CLASSPATH.

NOTE: It is better to use add dependencies to [pom.xml](../pom.xml). This directory should only be used when the library jars are not available as part in maven repositories.
23 changes: 14 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>no.sysco.middleware.metrics</groupId>
<artifactId>prometheus-jdbc-exporter</artifactId>
<version>1.2-SNAPSHOT</version>
<version>1.3-SNAPSHOT</version>
<packaging>jar</packaging>

<name>prometheus-jdbc-exporter</name>
Expand Down Expand Up @@ -32,27 +32,32 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.0.23</version>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.18</version>
<version>1.26</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
<version>0.0.21</version>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.1.7.v20120910</version>
<version>9.4.30.v20200611</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13</version>
</dependency>
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc</artifactId>
<version>3.12.13</version>
</dependency>
</dependencies>

Expand All @@ -62,7 +67,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -76,7 +81,7 @@
<!-- Build a full jar with dependencies -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<version>3.3.0</version>
<configuration>
<finalName>${project.build.finalName}</finalName>
<archive>
Expand All @@ -103,7 +108,7 @@
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.3.4</version>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private List<Collector.MetricFamilySamples> getSamples(JdbcConfig.Query query,
throws SQLException {
List<Collector.MetricFamilySamples.Sample> samples = new ArrayList<>();

final String queryName = String.format("jdbc_%s", query.name);
final String queryName = String.format("%s", query.name);
while (rs.next()) {
List<String> labelValues =
query.labels
Expand Down
1 change: 1 addition & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test