Version: v1.28.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 11 Imported by: 175


Jolokia Input Plugin

Deprecated in version 1.5: Please use the jolokia2 plugin

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the for more details.


# Read JMX metrics through Jolokia
  ## This is the context root used to compose the jolokia url
  ## NOTE that Jolokia requires a trailing slash at the end of the context root
  context = "/jolokia/"

  ## This specifies the mode used
  # mode = "proxy"
  ## When in proxy mode this section is used to specify further
  ## proxy address configurations.
  ## Remember to change host address to fit your environment.
  # [inputs.jolokia.proxy]
  #   host = ""
  #   port = "8080"

  ## Optional http timeouts
  ## response_header_timeout, if non-zero, specifies the amount of time to wait
  ## for a server's response headers after fully writing the request.
  # response_header_timeout = "3s"
  ## client_timeout specifies a time limit for requests made by this client.
  ## Includes connection time, any redirects, and reading the response body.
  # client_timeout = "4s"

  ## List of servers exposing jolokia read service
    name = "as-server-01"
    host = ""
    port = "8080"
    # username = "myuser"
    # password = "mypassword"

  ## List of metrics collected on above servers
  ## Each metric consists in a name, a jmx path and either
  ## a pass or drop slice attribute.
  ## This collect all heap memory usage metrics.
    name = "heap_memory_usage"
    mbean  = "java.lang:type=Memory"
    attribute = "HeapMemoryUsage"

  ## This collect thread counts metrics.
    name = "thread_count"
    mbean  = "java.lang:type=Threading"
    attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount"

  ## This collect number of class loaded/unloaded counts metrics.
    name = "class_count"
    mbean  = "java.lang:type=ClassLoading"
    attribute = "LoadedClassCount,UnloadedClassCount,TotalLoadedClassCount"


The Jolokia plugin collects JVM metrics exposed as MBean's attributes through jolokia REST endpoint. All metrics are collected for each server configured. See official Jolokia website for more information.


Jolokia plugin produces one measure for each metric configured, adding Server's jolokia_name, jolokia_host and jolokia_port as tags.

Example Output




This section is empty.


View Source
var DefaultClientTimeout = config.Duration(4 * time.Second)
View Source
var DefaultResponseHeaderTimeout = config.Duration(3 * time.Second)

Default http timeouts


This section is empty.


type Jolokia

type Jolokia struct {
	Context   string
	Mode      string
	Servers   []Server
	Metrics   []Metric
	Proxy     Server
	Delimiter string

	ResponseHeaderTimeout config.Duration `toml:"response_header_timeout"`
	ClientTimeout         config.Duration `toml:"client_timeout"`
	Log                   telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields

func (*Jolokia) Gather

func (j *Jolokia) Gather(acc telegraf.Accumulator) error

func (*Jolokia) SampleConfig

func (*Jolokia) SampleConfig() string

type JolokiaClient

type JolokiaClient interface {
	MakeRequest(req *http.Request) (*http.Response, error)

type JolokiaClientImpl

type JolokiaClientImpl struct {
	// contains filtered or unexported fields

func (JolokiaClientImpl) MakeRequest

func (c JolokiaClientImpl) MakeRequest(req *http.Request) (*http.Response, error)

type Metric

type Metric struct {
	Name      string
	Mbean     string
	Attribute string
	Path      string

type Server

type Server struct {
	Name     string
	Host     string
	Username string
	Password string
	Port     string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL