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

Prefer stdlib ReverseProxy implementation when no additional endpoint… #80

Merged
merged 1 commit into from
May 21, 2024

Conversation

philipgough
Copy link

@philipgough philipgough commented Feb 12, 2024

…s are configured

On the hot-path of Prometheus remote write, it might be best to avoid any custom proxying logic where we don't need to do so and defer to the ReverseProxy implementation to handle basic request forwarding!

Copy link

openshift-ci bot commented Feb 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@philipgough philipgough marked this pull request as ready for review May 9, 2024 15:49
@philipgough
Copy link
Author

/test sonar-pre-submit

Copy link

sonarqubecloud bot commented May 9, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 70%)

See analysis details on SonarCloud

Copy link

openshift-ci bot commented May 9, 2024

@philipgough: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sonar-pre-submit 7f45dca link true /test sonar-pre-submit

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@philipgough
Copy link
Author

/test test

Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

@moadz moadz left a comment

Choose a reason for hiding this comment

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

LGTM - some nits :)

// If there are remote write endpoints, we should proxy the remote write requests to them.
// This is atypical behavior and the majority of configurations will not have remote write endpoints
// where we can defer to stdlib ReverseProxy as below.
if c.endpoints != nil && len(c.endpoints) > 0 {
Copy link

Choose a reason for hiding this comment

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

I'm assuming endpoints here is the additional endpoints, not all obs-api endpoints?

nit: perhaps worth a refactor to make that clearer if it doesn't break the top-level config for this feature.

Copy link
Author

Choose a reason for hiding this comment

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

yes exactly, Id lean towards minimal changes here and push the refactor into #90 if we can

return r
}

if write != nil {
Copy link

Choose a reason for hiding this comment

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

Is there any case where write is nil? Is it worth including this as a check?

Copy link
Author

Choose a reason for hiding this comment

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

yes it could be an option. unlikely and for acm specific use case it wont be nil, but we just check it before registering the handler

Copy link

openshift-ci bot commented May 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: moadz, philipgough, saswatamcode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [philipgough,saswatamcode]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@philipgough philipgough merged commit 12f76df into stolostron:main May 21, 2024
4 of 7 checks passed
@philipgough philipgough deleted the proxy-writes branch May 21, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants