Skip to content

Commit

Permalink
config file support
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyogev committed Jul 24, 2019
1 parent c6fb9e5 commit 8602a32
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 42 deletions.
57 changes: 16 additions & 41 deletions config.conf
@@ -1,62 +1,37 @@
// See the comments throughout this file for usage.
//
// ********** IMPORTANT **********
// This configuration file is only used if you're launching jmx2logzio as a
// This configuration file is only used if you're launching jmx2graphite as a
// client connecting to a Jolokia agent.
//
// If you're running jmx2logzio as an agent without Jolokia, you need to
// configure jmx2logzio with runtime arguments.
// If you're running jmx2graphite as an agent without Jolokia, you need to
// configure jmx2graphite with runtime arguments.
// *******************************
//

# The service to poll the JMX metrics from
service {
// REQUIRED. Service name, to be included in reported metrics:

# Service name
name = "SERVICE_NAME"

// By default, hostname is pulled from the host machine.
// Here, you can override hostname to be included in reported metrics:
host = "docker"
# Hostname. If not supplied, taking hostname from jolokiaFullUrl
host = "SERVICE_HOST"

poller {
metrics-polling-interval-in-seconds = 30
white-list-regex = ".*"
black-list-regex = "$a"

jolokia {
// REQUIRED. URL of your Jolokia agent:
jolokiaFullUrl = "http://host.docker.internal:8778/jolokia/"
jolokiaFullUrl = "http://127.0.0.1:8778/jolokia/"
}
}
}

logzio-java-sender {
// REQUIRED. URL of the Logz.io listener.
// If your account is in the EU region, replace with https://listener-eu.logz.io:8071
url = "https://listener.logz.io:8071"

// REQUIRED. Your Logz.io account token. You can find your token at
// https://app.logz.io/#/dashboard/settings/manage-accounts
token = "<<ACCOUNT_TOKEN>>"

// This setting affects options below.
from-disk = true

// If from-disk=true, use these settings. Otherwise, you can remove them.
queue-dir = "metrics"
file-system-full-percent-threshold = 98
clean-sent-metrics-interval = 30
disk-space-checks-interval = 1000 // in milliseconds

// If from-disk=false, use these settings. Otherwise, you can remove them.
// in-memory-queue-capacity = 104857600 // in bytes (104857600 = 100MB)
// log-count-limit = -1
graphite {
hostname = "GRAPHITE_HOST"
port = 8080
protocol = "UDP"
connectTimeout = 10
socketTimeout = 5
}

//OPTIONAL. uncomment and edit this if you want to add your custom dimensions to the collected metrics
//extra-dimensions = {
// origin = "local"
// framework = "spring"
//}

//OPTIONAL.
//log-level= "DEBUG"
metricsPollingIntervalInSeconds = 30
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -120,7 +120,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9</version>
<version>2.9.9.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/log4j2.xml
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="30">
<Appenders>

<Console name="default.console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n"/>
</Console>
</Appenders>

<Loggers>

<!-- Enable this line to get a list of metric sent to logz.io -->
<!--<Logger name="io.logz.jmx2Graphite" level="trace">
<AppenderRef ref="default.console"/>
</Logger>-->

<Root level="info">
<AppenderRef ref="default.console"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 8602a32

Please sign in to comment.