-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Datasources: Add user_agent header customization for outgoing HTTP requests #63769
Conversation
@@ -484,6 +484,10 @@ Limits the amount of bytes that will be read/accepted from responses of outgoing | |||
|
|||
Limits the number of rows that Grafana will process from SQL (relational) data sources. Default is `1000000`. | |||
|
|||
### user_agent | |||
|
|||
Sets a custom value for `User-Agent` header for outgoing data proxy requests. If empty, default value will be `Grafana/<BuildVersion>` (e.g. `Grafana/9.0.0`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets a custom value for `User-Agent` header for outgoing data proxy requests. If empty, default value will be `Grafana/<BuildVersion>` (e.g. `Grafana/9.0.0`). | |
Sets a custom value for the `User-Agent` header for outgoing data proxy requests. If empty, the default value is `Grafana/<BuildVersion>` (for example `Grafana/9.0.0`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! Addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a suggestion for you. Thank you for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks great. A test failure needs to be fixed
@@ -243,7 +242,6 @@ func (e *AzureResourceGraphDatasource) createRequest(ctx context.Context, logger | |||
} | |||
req.URL.Path = "/" | |||
req.Header.Set("Content-Type", "application/json") | |||
req.Header.Set("User-Agent", fmt.Sprintf("Grafana/%s", setting.BuildVersion)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to have a failed test due to this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for contributing to Grafana |
Fix #63767 based on comment in the original discussion #58714