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

Adds a Global Header to all Grafana Terraform Provider requests #913

Merged

Conversation

elainevuong
Copy link
Contributor

Proposal to add a Global HTTP Custom Header to all requests coming from the Grafana Terraform Provider.

This PR would add the custom HTTP header:
"Grafana-Terraform-Provider" : "true"

to all requests originating from the Terraform Provider, in addition to any other http_headers or custom GRAFANA_HTTP_HEADERS environment variables that are set by the user.

@elainevuong elainevuong requested a review from a team as a code owner May 8, 2023 18:22
@github-actions
Copy link

github-actions bot commented May 8, 2023

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. To do so, a Grafana Labs employee must promote the Drone build.

For maintainers, it's better to run only the Cloud tests you need, rather than all of them. You can do so by setting the following parameter when promoting:

TESTARGS='-run=<testname>'

@elainevuong elainevuong merged commit 629fdfe into master May 8, 2023
@elainevuong elainevuong deleted the elainevuong/adds-grafana-terraform-provider-header branch May 8, 2023 18:38
func getHTTPHeadersMap(d *schema.ResourceData) (map[string]string, error) {
headers := map[string]string{"Grafana-Terraform-Provider": "true"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to ask after this is already merged, but:
What do you think about making this header more flexible? Maybe something like "Grafana-Request-Origion": "terraform"? That lets us provide options for other tooling in the future - we could propose adding headers to grabana and also to tools Grafana provides.

I've raised an issue on grafana/grafana

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open to renaming this key-value pair to something more suitable - let's see if anybody has more thoughts on the discussion within grafana/grafana that you've linked out below, and I'm open to modifying this.

@joeblubaugh
Copy link
Contributor

grafana/grafana#68049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants