uber-common / jvm-profiler

JVM Profiler Sending Metrics to Kafka, Console Output or Custom Reporter
Other
1.78k stars 342 forks source link

Add new InfluxDBOutputReporter in JVM Profiler #25

Closed baghelamit closed 5 years ago

baghelamit commented 5 years ago

A new reporter class to store metrics in InfluxDB time-series database. By default it uses below database connection properties

host = 127.0.0.1 port = 8086 database = metrics

These properties can be updated in InfluxDBOutputReporterclass or can be overridden by passing from yaml property file. To uses InfluxDBOutputReporter with default database connection properties, use it with reporter argument like below

reporter=com.uber.profiling.reporters.InfluxDBOutputReporter

To use database connection properties from yaml file use the reporter argument like below.

reporter=com.uber.profiling.reporters.InfluxDBOutputReporter,configProvider=com.uber.profiling.YamlConfigProvider,configFile=/opt/influxdb.yaml

hiboyang commented 5 years ago

Hi Amit, thanks for adding support for InfluxDB. I refactored the code so there will be no compile time dependency on each Reporter implementation. Also would you add a maven profile and put your InfluxDBOutputReporter in another directory to avoid Influx dependency on default maven profile? You could see how it does with Redis in pom.xml.

baghelamit commented 5 years ago

Bo, I added InfluxDBOutputReporterto maven profile. I created com.uber.profiling.reporters package under "java_influxdb" folder. You have to create reporters folder for RedisOutputReporter. The package declaration in this class is com.uber.profiling.reporters but package structure inside "java_redis" folder is com.uber.profiling.