-
Notifications
You must be signed in to change notification settings - Fork 630
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
Allow setting the User Agent Operator suffix #2831
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduces a `UserAgentBuilder` method that allows us to build contextually conditional user agent strings based on the plugin and operator suffix provided by the user. Signed-off-by: Jacob Bednarz <[email protected]>
Within the Terraform ecosystem, there are multiple ways of using the providers. Generally, it is through the Terraform CLI however, there are third party tools like Pulumi that rely on the schemas to build their own integrations. One issue with this is that the requests they make are lumped with the label of `terraform/<version>` in the HTTP user agent which doesn’t allow observablility into those specific requests. To enable better visibility here, we are introducing a new schema field called a User Agent Operator suffix. It is configurable in the schema (`user_agent_operator_suffix`) and via the environment variable (`CLOUDFLARE_USER_AGENT_OPERATOR_SUFFIX `) and will provide a way for these third party integrations to denote the source of their requests.⚠️ This *is not* a recommended configuration change for most and when not explicitly configured will default to the existing `terraform/<version>` string (as it always has). You should only change this value if you know what you are doing. Signed-off-by: Jacob Bednarz <[email protected]>
jacobbednarz
force-pushed
the
allow-ua-operator-appending
branch
from
October 11, 2023 02:23
264d8b4
to
dc00571
Compare
changelog detected ✅ |
jacobbednarz
commented
Oct 11, 2023
jacobbednarz
commented
Oct 11, 2023
Before this change, we relied on the plugin libraries to expose their version. Unfortunately, this was incorrectly set in SDKv2[1] and non-existent in the framework[2]. The recommended approach is to instead dig into the build information via`runtime/debug.ReadBuildInfo()`[3] which is what we introduce here in a slightly safer and consistent way. [1]: hashicorp/terraform-plugin-sdk#1257 [2]: hashicorp/terraform-plugin-framework#855 [3]: https://pkg.go.dev/runtime/debug#ReadBuildInfo Signed-off-by: Jacob Bednarz <[email protected]>
fyi @jaxxstorm |
This functionality has been released in v4.17.0 of the Terraform Cloudflare Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Within the Terraform ecosystem, there are multiple ways of using the
providers. Generally, it is through the Terraform CLI however, there are
third party tools like Pulumi that rely on the schemas to build their
own integrations.
One issue with this is that the requests they make are lumped with the
label of
terraform/<version>
in the HTTP user agent which doesn’tallow observablility into those specific requests. To enable better
visibility here, we are introducing a new schema field called a User
Agent Operator suffix. It is configurable in the schema
(
user_agent_operator_suffix
) and via the environment variable(
CLOUDFLARE_USER_AGENT_OPERATOR_SUFFIX
) and will provide a way forthese third party integrations to denote the source of their requests.
explicitly configured will default to the existing
terraform/<version>
string (as it always has). You should only change this value if you know
what you are doing.
Supersedes and closes #2816