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

fix: ensure aliyuncms metrics accept array, fix discovery #10850

Merged
merged 4 commits into from
Apr 12, 2022

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Mar 18, 2022

First, the aliyuncms plugin was not correctly parsing metrics with multiple dimensions. This was due to some bad if/else logic. Once fixed users can do the following in their config:

    dimensions = '[{"instanceId": "rm-bp1zureya4l415lus"},{"instanceId": "rm-bp161628eanrceqz2"}]'

Second, the plugin can do some auto-discovery of the JSON response that is received and then determine how to parse the response. However, it appears that aliyun/alibaba has updated some of the responses. This adds a responseRootKey rather than trying to determine that as the logic was not correct and no longer consistent across services. We already have a hard-coded responseObjectIDKey that is used as part of that root key.

Finally, this updates the aliyun SDK.

Fixes: #10848

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Mar 18, 2022
@powersj powersj force-pushed the fix/aliyuncms-dimensions-array branch 4 times, most recently from 90a862e to bfa77e1 Compare March 28, 2022 15:22
@powersj powersj changed the title fix: ensure aliyuncms metrics accept array fix: ensure aliyuncms metrics accept array, fix discovery Mar 31, 2022
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 31, 2022
@powersj powersj force-pushed the fix/aliyuncms-dimensions-array branch from 5a2c8c6 to a8c5948 Compare April 12, 2022 21:12
@telegraf-tiger
Copy link
Contributor

@powersj powersj merged commit 03847d8 into influxdata:master Apr 12, 2022
sspaink pushed a commit that referenced this pull request Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inputs.aliyuncms multiple dimensions doesnt work
2 participants