Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick to 6.6: Add support in jolokia get response for single value (#11075) #11117

Merged
merged 4 commits into from
Mar 7, 2019
Merged

Cherry-pick to 6.6: Add support in jolokia get response for single value (#11075) #11117

merged 4 commits into from
Mar 7, 2019

Conversation

kaiyan-sheng
Copy link
Contributor

Original message:
Jolokia module fails to parse some responses fetched using the GET method with error:

json: cannot unmarshal number into Go struct field Entry.Value of type map[string]interface {}
failed to unmarshal jolokia JSON response '{"request":{"mbean":"java.lang:type=Runtime","attribute":"Uptime","type":"read"},"value":88622,"timestamp":1551739190,"status":200}'

This is because value field can be a map[string]interface or it can also be just a float.

(cherry picked from commit c238ea2)

* Add support in jolokia get response for single value

* Use reflect.TypeOf to check attribute and value type

* Add changelog

* Replace reflect by type switching

* Fix indentation for comments

(cherry picked from commit c238ea2)
"event": {
"dataset": "jolokia.testnamespace",
"duration": 115000,
"module": "jolokia"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in the backport to 6.7, I don't think this has to change.

@kaiyan-sheng
Copy link
Contributor Author

jenkins, test this please

@ruflin
Copy link
Contributor

ruflin commented Mar 7, 2019

@kaiyan-sheng Can you add / fix labels on this PR?

@kaiyan-sheng kaiyan-sheng self-assigned this Mar 7, 2019
@kaiyan-sheng
Copy link
Contributor Author

@kaiyan-sheng Can you add / fix labels on this PR?

Done

@kaiyan-sheng kaiyan-sheng merged commit 9d1010b into elastic:6.6 Mar 7, 2019
@kaiyan-sheng kaiyan-sheng deleted the backport_11075_6.6 branch March 7, 2019 14:10
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…lue (elastic#11075) (elastic#11117)

* Add support in jolokia get response for single value (elastic#11075)

(cherry picked from commit 1d966f2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants