Skip to content

Commit

Permalink
Add trailing slash to jolokia context (influxdata#2105)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpall authored and Nick White committed Jan 31, 2017
1 parent fe70b01 commit 18d8625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plugins/inputs/jolokia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Read JMX metrics through Jolokia
[[inputs.jolokia]]
## This is the context root used to compose the jolokia url
context = "/jolokia"
## NOTE that Jolokia requires a trailing slash at the end of the context root
context = "/jolokia/"

## This specifies the mode used
# mode = "proxy"
Expand Down
5 changes: 3 additions & 2 deletions plugins/inputs/jolokia/jolokia.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ type Jolokia struct {

const sampleConfig = `
## 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
## NOTE that your jolokia security policy must allow for POST requests.
context = "/jolokia"
context = "/jolokia/"
## This specifies the mode used
# mode = "proxy"
Expand Down Expand Up @@ -148,7 +149,7 @@ func (j *Jolokia) doRequest(req *http.Request) (map[string]interface{}, error) {

func (j *Jolokia) prepareRequest(server Server, metric Metric) (*http.Request, error) {
var jolokiaUrl *url.URL
context := j.Context // Usually "/jolokia"
context := j.Context // Usually "/jolokia/"

// Create bodyContent
bodyContent := map[string]interface{}{
Expand Down

0 comments on commit 18d8625

Please sign in to comment.