From 084f73c0ea84091ec03e370aa739f5d37a9a413a Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 27 Sep 2017 10:52:10 -0700 Subject: [PATCH] Add deprecation notice to jolokia plugin --- plugins/inputs/jolokia/README.md | 2 ++ plugins/inputs/jolokia/jolokia.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/plugins/inputs/jolokia/README.md b/plugins/inputs/jolokia/README.md index 9d33c8a2b..2622d83bc 100644 --- a/plugins/inputs/jolokia/README.md +++ b/plugins/inputs/jolokia/README.md @@ -1,5 +1,7 @@ # Telegraf plugin: Jolokia +**Deprecated in version 1.5:** Please use the [jolokia2](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia2) plugin. + #### Configuration ```toml diff --git a/plugins/inputs/jolokia/jolokia.go b/plugins/inputs/jolokia/jolokia.go index 0a9122b87..a538d8191 100644 --- a/plugins/inputs/jolokia/jolokia.go +++ b/plugins/inputs/jolokia/jolokia.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "log" "net/http" "net/url" "time" @@ -254,6 +255,10 @@ func (j *Jolokia) extractValues(measurement string, value interface{}, fields ma func (j *Jolokia) Gather(acc telegraf.Accumulator) error { if j.jClient == nil { + log.Println("W! DEPRECATED: the jolokia plugin has been deprecated " + + "in favor of the jolokia2 plugin " + + "(https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia2)") + tr := &http.Transport{ResponseHeaderTimeout: j.ResponseHeaderTimeout.Duration} j.jClient = &JolokiaClientImpl{&http.Client{ Transport: tr,