###############################################################################
INPUT PLUGINS
###############################################################################
Read formatted metrics from one or more HTTP endpoints
[[inputs.http]]
urls = [
“http ://a.b.c.d:13098/myapp1/info”,
“http ://p.q.r.s:11097/myapp2/info”,
“http ://m.n.o.p:13098/myapp3/info”,
“http ://s.t.u.v:11097/myapp4/info”
// TOTAL 203 INFO URL’s listed here
]
## Amount of time allowed to complete the HTTP request
timeout = “250ms”
name_override = “app_info”
data_format = “json”
json_query = “build”
json_string_fields = [“name”, “version”]
[[inputs.http]]
urls = [
“http ://a.b.c.d:13098/myapp1/health”,
“http ://p.q.r.s:11097/myapp2/health”,
“http ://m.n.o.p:13098/myapp3/health”,
“http ://s.t.u.v:11097/myapp4/health”
// TOTAL 203 HEALTH URL’s listed here
]
## Amount of time allowed to complete the HTTP request
timeout = “250ms”
name_override = “app_health”
data_format = “json”
json_string_fields = [“status”]
# Read JMX metrics through Jolokia
[[inputs.jolokia2_agent]]
response_timeout=“250ms”
urls = [
“http ://a.b.c.d:13098/myapp1/jolokia”,
“http ://p.q.r.s:11097/myapp2/jolokia”
// TOTAL 193 Jolokia URL’s listed here
]
[[inputs.jolokia2_agent]]
response_timeout=“350ms”
urls = [
“http ://m.n.o.p:13098/myapp3/jolokia”,
“http ://s.t.u.v:11097/myapp4/jolokia”
// TOTAL 10 Jolokia URL’s listed here
]
[[inputs.jolokia2_agent.metric]]
name = "java_runtime"
mbean = "java.lang:type=Runtime"
paths = ["Uptime"]
[[inputs.jolokia2_agent.metric]]
name = "java_memory"
mbean = "java.lang:type=Memory"
paths = ["HeapMemoryUsage", "NonHeapMemoryUsage"]
[[inputs.jolokia2_agent.metric]]
name = "java_os"
mbean = "java.lang:type=OperatingSystem"
paths = ["ProcessCpuLoad", "ProcessCpuTime", "SystemCpuLoad", "TotalPhysicalMemorySize", "TotalSwapSpaceSize", "FreePhysicalMemorySize", "FreeSwapSpaceSize"]
# windows hosts don't have those metrics, hence splitting inputs
[[inputs.jolokia2_agent.metric]]
name = "java_os"
mbean = "java.lang:type=OperatingSystem"
paths = ["OpenFileDescriptorCount", "MaxFileDescriptorCount"]
[[inputs.jolokia2_agent.metric]]
name = "java_memory_pool"
mbean = "java.lang:name=*,type=MemoryPool"
paths = ["Usage", "PeakUsage", "CollectionUsage"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metric]]
name = "java_garbage_collector"
mbean = "java.lang:name=*,type=GarbageCollector"
paths = ["CollectionTime", "CollectionCount"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metric]]
name = "java_last_garbage_collection"
mbean = "java.lang:name=*,type=GarbageCollector"
paths = ["LastGcInfo"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metric]]
name = "java_threading"
mbean = "java.lang:type=Threading"
paths = ["TotalStartedThreadCount", "ThreadCount", "DaemonThreadCount", "PeakThreadCount"]
[[inputs.jolokia2_agent.metric]]
name = "java_class_loading"
mbean = "java.lang:type=ClassLoading"
paths = ["LoadedClassCount", "UnloadedClassCount", "TotalLoadedClassCount"]
[[inputs.jolokia2_agent.metric]]
name = "app_info"
mbean = "org.springframework.boot:name=infoEndpoint,type=Endpoint"
paths = ["Data/build/name", "Data/build/version"]
[[inputs.jolokia2_agent.metric]]
name = "app_health"
mbean = "org.springframework.boot:name=healthEndpoint,type=Endpoint"
paths = ["Data/status", "Data.diskSpace.total", "Data.diskSpace.free"]
[[inputs.jolokia2_agent.metric]]
name = "tomcat_threads"
mbean = "Tomcat:name=*,type=ThreadPool"
paths = ["maxThreads", "currentThreadsCount", "currentThreadsBusy"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metric]]
name = "app_db_connection_pool"
mbean = "com.app.analytics.cal:type=DataSource,name=*"
tag_keys = ["name"]
###############################################################################
PROCESSOR PLUGINS
###############################################################################
[[processors.regex]]
order = 1
[[processors.regex.tags]]
key = “jolokia_agent_url”
pattern = “^http://[^/]+/([^/]+)/jolokia$”
replacement = “${1}”
result_key = “service_name”
[[processors.regex.tags]]
key = “jolokia_agent_url”
pattern = “^http://([^:]+):\d+/[^/]+/jolokia$”
replacement = “${1}”
result_key = “instance_host”
[[processors.regex.tags]]
key = “jolokia_agent_url”
pattern = “^http://([^/]+)/[^/]+/jolokia$”
replacement = “${1}”
result_key = “instance_address”
[[processors.regex.tags]]
key = “url”
pattern = “^http://[^/]+/([^/]+)/(info|health)$”
replacement = “${1}”
result_key = “service_name”
[[processors.regex.tags]]
key = “url”
pattern = “^http://([^:]+):\d+/[^/]+/(info|health)$”
replacement = “${1}”
result_key = “instance_host”
[[processors.regex.tags]]
key = “url”
pattern = “^http://([^/]+)/[^/]+/(info|health)$”
replacement = “${1}”
result_key = “instance_address”
[[processors.regex]]
order = 2
[[processors.regex.tags]]
key = "url"
pattern = "^http://([^/]+/[^/]+/)(info|health)$"
replacement = "http://${1}jolokia"
result_key = "jolokia_agent_url"
[[processors.rename]]
order = 3
namepass = [“app_info”,“app_health”]
[[processors.rename.replace]]
field = "name"
dest = "Data.build.name"
[[processors.rename.replace]]
field = "version"
dest = "Data.build.version"
[[processors.rename.replace]]
field = "status"
dest = "Data.status"