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(inputs.stackdriver): Handle when no buckets available #11556

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Jul 27, 2022

resolve: #11545

The methods to get buckets could return nil, if all buckets returned nil this wasn't being checked which caused the panic reported in the issue. The code was also getting all buckets even though it if the first bucket type (linear buckets) wasn't nil, although it wouldn't use the other buckets so these were wasted requests. Updated the logic to only continue trying the next bucket type if the previous wasn't nil, following the same precedence logic as before. If all buckets are nil then an error is returned. As you can see in the test some metrics are still gathered, this is existing behavior so I didn't change anything there.

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @sspaink. Just one small suggestion... Other than that the code looks good.

@srebhan srebhan self-assigned this Jul 27, 2022
@srebhan srebhan added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label Jul 27, 2022
@telegraf-tiger
Copy link
Contributor

@sspaink sspaink merged commit b87d06e into master Jul 27, 2022
@sspaink sspaink deleted the stackdriverpanicfix branch July 27, 2022 15:31
reimda pushed a commit that referenced this pull request Aug 15, 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 plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stackdriver plugin gives SIGSEGV when trying to download metric GAUGE/DISTRIBUTION
3 participants