search
数据采集 采集源配置 Jolokia 指标采集

Jolokia 指标采集

简介

采集 jolokia 指标上报到 DataFlux 中

前置条件

配置

进入 DataKit 安装目录下的 conf.d/jolokia2_agent 目录,复制 jolokia2_agent.conf.sample 并命名为 jolokia2_agent.conf。示例如下:

设置:

[[inputs.jolokia2_agent]]
urls = ["http://agent:8080/jolokia"]

[[inputs.jolokia2_agent.metric]]
        name  = "jvm_runtime"
        mbean = "java.lang:type=Runtime"
        paths = ["Uptime"]

## #Optionally, specify TLS options for communicating with agents:

#[[inputs.jolokia2_agent]]
#       urls = ["https://agent:8080/jolokia"]
#       tls_ca   = "/var/private/ca.pem"
#       tls_cert = "/var/private/client.pem"
#       tls_key  = "/var/private/client-key.pem"
#       #insecure_skip_verify = false
#
#       [[inputs.jolokia2_agent.metric]]
#       name  = "jvm_runtime"
#       mbean = "java.lang:type=Runtime"
#       paths = ["Uptime"]

## #Jolokia Proxy Configuration
## #The jolokia2_proxy input plugin reads JMX metrics from one or more targets by interacting with a Jolokia ## ## #proxy REST endpoint.

#[[inputs.jolokia2_proxy]]
#  url = "http://proxy:8080/jolokia"

#  #default_target_username = ""
#  #default_target_password = ""
#  [[inputs.jolokia2_proxy.target]]
#    url = "service:jmx:rmi:///jndi/rmi://#targethost:9999/jmxrmi"
#    # username = ""
#    # password = ""

#  [[inputs.jolokia2_proxy.metric]]
#    name  = "jvm_runtime"
#    mbean = "java.lang:type=Runtime"
#    paths = ["Uptime"]

配置好后,重启 DataKit 即可生效