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

[PR] Support custom HTTP headers #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kwSeo
Copy link

@kwSeo kwSeo commented Jul 23, 2023

Updates

@kwSeo kwSeo changed the title Feature/add custom http headers [PR] Support custom HTTP headers Jul 23, 2023
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks, added a suggestion, otherwise LGTM, thanks! 💪🏽

@@ -49,6 +50,7 @@ var (
remoteTenant = kingpin.Flag("remote-tenant", "Tenant ID to include in remote_write send").Default("0").String()
Copy link
Member

Choose a reason for hiding this comment

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

If we do what's in your PR, I would then remove remoteTenant flag and feature, as it will be possible via your flag. WDYT? I think breaking change here is fine, given it's a testing tool and not in a major version yet. WDYT?

@@ -80,17 +86,21 @@ func SendRemoteWrite(config *ConfigWrite) error {
return c.write()
}

// Add the tenant ID header
// Add the tenant ID header and custom headers
func (rt *tenantRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I would not overload tenant RT in a hidden way - given custom headers gives more flexible let's remove tenant feature and expect users to pass custom header for tenant header AND rename those round tripper as customHeaderRoundTripper WDYT? (:

Copy link
Contributor

Choose a reason for hiding this comment

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

why not using the http client from common, which supports custom headers?

Copy link
Contributor

Choose a reason for hiding this comment

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

why not using the http client from common, which supports custom headers?

Copy link
Member

Choose a reason for hiding this comment

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

👍🏽

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