Skip to content

Commit

Permalink
Add trailing slash to jolokia context
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Pall committed Nov 30, 2016
1 parent 04a2b36 commit 0d3487d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/inputs/jolokia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Read JMX metrics through Jolokia
[[inputs.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
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 0d3487d

Please sign in to comment.