diff --git a/CHANGELOG.md b/CHANGELOG.md index a307b8764..c1d309f82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ### Release Notes +- **Breaking change** in jolokia plugin. See +https://github.com/influxdata/telegraf/blob/master/plugins/inputs/jolokia/README.md +for updated configuration. The plugin will now support proxy mode and will make +POST requests. + - New [agent] configuration option: `metric_batch_size`. This option tells telegraf the maximum batch size to allow to accumulate before sending a flush to the configured outputs. `metric_buffer_limit` now refers to the absolute @@ -45,6 +50,7 @@ based on _prefix_ in addition to globs. This means that a filter like ### Features +- [#1031](https://github.com/influxdata/telegraf/pull/1031): Jolokia plugin proxy mode. Thanks @saiello! - [#1017](https://github.com/influxdata/telegraf/pull/1017): taginclude and tagexclude arguments. - [#1015](https://github.com/influxdata/telegraf/pull/1015): Docker plugin schema refactor. - [#889](https://github.com/influxdata/telegraf/pull/889): Improved MySQL plugin. Thanks @maksadbek! @@ -61,6 +67,7 @@ based on _prefix_ in addition to globs. This means that a filter like ### Bugfixes +- [#1050](https://github.com/influxdata/telegraf/issues/1050): jolokia plugin - do not overwrite host tag. Thanks @saiello! - [#921](https://github.com/influxdata/telegraf/pull/921): mqtt_consumer stops gathering metrics. Thanks @chaton78! - [#1013](https://github.com/influxdata/telegraf/pull/1013): Close dead riemann output connections. Thanks @echupriyanov! - [#1012](https://github.com/influxdata/telegraf/pull/1012): Set default tags in test accumulator. @@ -82,10 +89,8 @@ https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md#g - Possible breaking change for the librato and graphite outputs. Telegraf will no longer insert field names when the field is simply named `value`. This is because the `value` field is redundant in the graphite/librato context. -- Breaking change in jolokia plugin. See https://github.com/influxdata/telegraf/blob/master/plugins/inputs/jolokia/README.md ### Features -- [#1031](https://github.com/influxdata/telegraf/pull/1031): Jolokia plugin proxy mode. Thanks @saiello! - [#1009](https://github.com/influxdata/telegraf/pull/1009): Cassandra input plugin. Thanks @subhachandrachandra! - [#976](https://github.com/influxdata/telegraf/pull/976): Reduce allocations in the UDP and statsd inputs. - [#979](https://github.com/influxdata/telegraf/pull/979): Reduce allocations in the TCP listener. @@ -98,7 +103,6 @@ because the `value` field is redundant in the graphite/librato context. - [#1008](https://github.com/influxdata/telegraf/pull/1008): Adding memstats metrics to the influxdb plugin. ### Bugfixes -- [#1050](https://github.com/influxdata/telegraf/issues/1050): jolokia plugin - do not overwrite host tag. Thanks @saiello! - [#968](https://github.com/influxdata/telegraf/issues/968): Processes plugin gets unknown state when spaces are in (command name) - [#969](https://github.com/influxdata/telegraf/pull/969): ipmi_sensors: allow : in password. Thanks @awaw! - [#972](https://github.com/influxdata/telegraf/pull/972): dovecot: remove extra newline in dovecot command. Thanks @mrannanj! diff --git a/plugins/inputs/jolokia/README.md b/plugins/inputs/jolokia/README.md index 05ade3d01..596dbed5f 100644 --- a/plugins/inputs/jolokia/README.md +++ b/plugins/inputs/jolokia/README.md @@ -3,20 +3,23 @@ #### Configuration ```toml +# Read JMX metrics through Jolokia [[inputs.jolokia]] ## This is the context root used to compose the jolokia url context = "/jolokia" - # This specifies the mode used + ## This specifies the mode used # mode = "proxy" # - # When in proxy mode this section is used to specify further proxy address configurations. - # Remember to change servers addresses + ## 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 = "127.0.0.1" - # port = "8080" + # host = "127.0.0.1" + # port = "8080" - # List of servers exposing jolokia read service + + ## List of servers exposing jolokia read service [[inputs.jolokia.servers]] name = "as-server-01" host = "127.0.0.1" @@ -37,21 +40,22 @@ [[inputs.jolokia.metrics]] name = "thread_count" mbean = "java.lang:type=Threading" - attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount" + attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount" ## This collect number of class loaded/unloaded counts metrics. [[inputs.jolokia.metrics]] name = "class_count" mbean = "java.lang:type=ClassLoading" - attribute = "LoadedClassCount,UnloadedClassCount,TotalLoadedClassCount" + attribute = "LoadedClassCount,UnloadedClassCount,TotalLoadedClassCount" ``` #### Description -The Jolokia plugin collects JVM metrics exposed as MBean's attributes through jolokia REST endpoint. All metrics -are collected for each server configured. +The Jolokia plugin collects JVM metrics exposed as MBean's attributes through +jolokia REST endpoint. All metrics are collected for each server configured. See: https://jolokia.org/ # Measurements: -Jolokia plugin produces one measure for each metric configured, adding Server's `server_name`, `server_host` and `server_port` as tags. +Jolokia plugin produces one measure for each metric configured, +adding Server's `jolokia_name`, `jolokia_host` and `jolokia_port` as tags. diff --git a/plugins/inputs/jolokia/jolokia.go b/plugins/inputs/jolokia/jolokia.go index 08256ce85..244338559 100644 --- a/plugins/inputs/jolokia/jolokia.go +++ b/plugins/inputs/jolokia/jolokia.go @@ -226,9 +226,9 @@ func (j *Jolokia) Gather(acc telegraf.Accumulator) error { tags := make(map[string]string) for _, server := range servers { - tags["server_name"] = server.Name - tags["server_port"] = server.Port - tags["server_host"] = server.Host + tags["jolokia_name"] = server.Name + tags["jolokia_port"] = server.Port + tags["jolokia_host"] = server.Host fields := make(map[string]interface{}) for _, metric := range metrics { diff --git a/plugins/inputs/jolokia/jolokia_test.go b/plugins/inputs/jolokia/jolokia_test.go index ff0c0e49d..13724b937 100644 --- a/plugins/inputs/jolokia/jolokia_test.go +++ b/plugins/inputs/jolokia/jolokia_test.go @@ -96,9 +96,9 @@ func TestHttpJsonMultiValue(t *testing.T) { "heap_memory_usage_used": 203288528.0, } tags := map[string]string{ - "server_host": "127.0.0.1", - "server_port": "8080", - "server_name": "as1", + "jolokia_host": "127.0.0.1", + "jolokia_port": "8080", + "jolokia_name": "as1", } acc.AssertContainsTaggedFields(t, "jolokia", fields, tags) }