Metric reporting to PostgreSQL

39 views
Skip to first unread message

Łukasz Wiecheć

unread,
Nov 7, 2017, 10:46:35 AM11/7/17
to metrics-user

Hello,

due to the limitations of my deployment environment I cannot deploy any of the 'preferred' databases to store Java Metrics (InfluxDB, Graphite etc). However, I have a PostgreSQL database running there. I thought I could report the metrics there. It's just for storage and possible further later analysis; not for using it in a dashboard, for example.

Searching the net for such reporter gives me back nothing.

Does anyone of you know if there is a 'reporter to PostgreSQL' that I don't know about?...

Cheers,
Ł. Wiecheć

Isuru Perera

unread,
Nov 8, 2017, 2:14:57 AM11/8/17
to metrics-user
Hello,

I developed a JDBC reporter to store metrics in database. You can try following dependency from WSO2 repository: http://maven.wso2.org/nexus/content/groups/wso2-public/

<dependency>
<groupId>org.wso2.carbon.metrics</groupId>
<artifactId>org.wso2.carbon.metrics.jdbc.reporter</artifactId>
<version>2.3.5</version>
</dependency>

Source code is at https://github.com/wso2/carbon-metrics/tree/master/components/org.wso2.carbon.metrics.jdbc.reporter and relevant DB scripts are at https://github.com/wso2/carbon-metrics/tree/master/features/org.wso2.carbon.metrics.jdbc.core.feature/resources/sql

Test code: https://github.com/wso2/carbon-metrics/blob/master/components/org.wso2.carbon.metrics.jdbc.reporter/src/test/java/org/wso2/carbon/metrics/jdbc/reporter/JdbcReporterTest.java

There is a parameter named "source", which is used to identify the metrics reported by multiple JVMs. So, the "source" has to be unique for every JVM.

I hope you will be able to use this JDBC reporter directly.

Thank you.

Łukasz Wiecheć

unread,
Nov 8, 2017, 6:39:43 AM11/8/17
to metrics-user
Big thanks Isuru, I will give it a go!

Łukasz
Reply all
Reply to author
Forward
0 new messages