Version: v1.20.4 Latest Latest

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 10 Imported by: 160


Jolokia Input Plugin

Deprecated in version 1.5: Please use the jolokia2 plugin.
# 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.



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




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) Description

func (j *Jolokia) Description() string

func (*Jolokia) Gather

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

func (*Jolokia) SampleConfig

func (j *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

Source Files

Jump to

Keyboard shortcuts

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