Add deprecation notice to jolokia plugin

This commit is contained in:
Daniel Nelson 2017-09-27 10:52:10 -07:00
parent b8a0b8461a
commit 9bddd50a64
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,7 @@
# Telegraf plugin: Jolokia # Telegraf plugin: Jolokia
**Deprecated in version 1.5:** Please use the [jolokia2](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia2) plugin.
#### Configuration #### Configuration
```toml ```toml

View File

@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"net/http" "net/http"
"net/url" "net/url"
"time" "time"
@ -254,6 +255,10 @@ func (j *Jolokia) extractValues(measurement string, value interface{}, fields ma
func (j *Jolokia) Gather(acc telegraf.Accumulator) error { func (j *Jolokia) Gather(acc telegraf.Accumulator) error {
if j.jClient == nil { 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} tr := &http.Transport{ResponseHeaderTimeout: j.ResponseHeaderTimeout.Duration}
j.jClient = &JolokiaClientImpl{&http.Client{ j.jClient = &JolokiaClientImpl{&http.Client{
Transport: tr, Transport: tr,