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

feat(outputs.wavefront): Add more auth options and update SDK #13857

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

LukeWinikates
Copy link
Contributor

@LukeWinikates LukeWinikates commented Sep 1, 2023

This PR updates the Wavefront output plugin to use the latest version of the Wavefront Go SDK. The new version adds support for additional authentication flavors, and a configuration setting for opting out of sending internal SDK metrics.

@telegraf-tiger telegraf-tiger bot added area/wavefront feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Sep 1, 2023
@LukeWinikates
Copy link
Contributor Author

Wavefront is transitioning from 1 supported authentication flavor to 3.

For now we'll continue to have the API token option we've always had, but moving forward we'll also have two "CSP" options - CSP is VMware's OAuth provider for VMware products.

These options all have different required fields, and putting them into the top-level TOML document for the output is proving hard to document, and makes for a messy conditional code path.

I would be interested in doing something like:

[[outputs.wavefront]]
url = "https://metrics.wavefront.com"

[[outputs.wavefront.authentication]]
kind = "wavefront-token"
token = "my-token"

[[outputs.wavefront.authentication]]
kind = "csp-api-token"

[[outputs.wavefront.authentication]]
kind = "csp-client-credentials"

or maybe the sub-table would be [[outputs.wavefront.csp-token]], etc without the kind field?

I couldn't find a precedent for that pattern in the Telegraf codebase. Is it worth pursuing? Do any Telegraf folks have any suggestions for how to manage this situation?

We're not happy with the documentation of the fields in the sample config right now - based on responses to the above, we'll improve that documentation before merge.

@LukeWinikates LukeWinikates force-pushed the wavefront-add-csp branch 2 times, most recently from d8aed1b to f9e0cc4 Compare September 1, 2023 20:04
Copy link
Contributor

@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 nice update @LukeWinikates! Two minor comments from my side...

Regarding the option scheme/strategy: I think we can keep the top-level options (and the ifs) if we don't expect the number of options to grow much more... However, if you like like I would create auth-style specific structs and option-tables like [wavefront.auth_csp_api], [wavefront.auth_csp_app], etc.

plugins/outputs/wavefront/wavefront.go Outdated Show resolved Hide resolved
plugins/outputs/wavefront/wavefront.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Sep 5, 2023
@srebhan srebhan changed the title feat(outputs.wavefront): update wavefront-sdk-go and add support for … feat(outputs.wavefront): Add more auth options and update SDK Sep 5, 2023
@LukeWinikates LukeWinikates force-pushed the wavefront-add-csp branch 5 times, most recently from 22ad4f5 to cb0b141 Compare September 5, 2023 22:59
@LukeWinikates
Copy link
Contributor Author

@srebhan thanks for your feedback and for the suggestion about the sub-table solution. Since only the client credentials option has several fields to configure, I only extracted a sub-table for that one. I tested the build artifacts on my team's side. I think this PR is ready to be squashed and merged - let us know if you see any other changes we need to make.

Copy link
Contributor

@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.

There is one problem with the config layout due to TOML's handling of "tables", see my comment in the code...

plugins/outputs/wavefront/README.md Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
plugins/outputs/wavefront/wavefront.go Outdated Show resolved Hide resolved
@LukeWinikates
Copy link
Contributor Author

@srebhan I think this is good to go now! Not sure why the windows test fails.

Copy link
Contributor

@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.

I will push the two whitespace fixes and then we are good.

plugins/outputs/wavefront/README.md Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
@srebhan srebhan 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 Sep 7, 2023
@srebhan srebhan assigned powersj and unassigned srebhan Sep 7, 2023
Copy link
Contributor

@powersj powersj 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 updates. Some comments around the README/sample config. Remember to update in both places.

plugins/outputs/wavefront/README.md Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
plugins/outputs/wavefront/sample.conf Outdated Show resolved Hide resolved
jbooherl and others added 2 commits September 8, 2023 11:35
…CSP authentication

Co-authored-by: Priya Selvaganesan <pselvaganesa@vmware.com>
Co-authored-by: Luke Winikates <winikatesl@vmware.com>
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Sep 8, 2023

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thank you for the continued updates and shepherding of the plugin.

@powersj powersj merged commit d807dd3 into influxdata:master Sep 8, 2023
23 checks passed
@github-actions github-actions bot added this to the v1.28.0 milestone Sep 8, 2023
athornton pushed a commit to lsst-sqre/telegraf that referenced this pull request Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/wavefront feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins 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.

None yet

4 participants