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

server: correctly route PATCH requests when using RouteHTTPToGRPC #347

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

yvrhdn
Copy link
Member

@yvrhdn yvrhdn commented Aug 4, 2023

What this PR does:

Tempo relies on the RouteHTTPToGRPC option in server to handle HTTP and gRPC requests from a single endpoint. This options configures a multiplexer (soheilhy/cmux) to match and route HTTP and gRPC requests to their respective listener.

For HTTP matching it uses cmux.HTTP1Fast which matches the method of the request with a predefined set of methods. This change adds PATCH to the list to ensure PATCH requests are also sent to the HTTP listener.

More details here: grafana/tempo#2756
For context, this configuration option was added a couple of months ago to support Tempo: weaveworks/common#288

Which issue(s) this PR fixes:
Fixes grafana/tempo#2756

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@yvrhdn
Copy link
Member Author

yvrhdn commented Aug 8, 2023

FYI draft PR to show this change works on Tempo: all tests succeed except vendor-check.

@joe-elliott
Copy link
Member

Now that this in dskit we may want to restructure this code, but I think this is fine for now. At the time I was trying to write in the style of the library, but I think we should adjust this to just allow for some functions to be passed in as hooks where the caller can just inject the behavior necessary.

@yvrhdn yvrhdn merged commit 1a21a6b into grafana:main Aug 8, 2023
@yvrhdn yvrhdn deleted the kvrhdn/server-patch branch August 8, 2023 15:19
MichelHollands added a commit to grafana/loki that referenced this pull request Aug 14, 2023
**What this PR does / why we need it**:

This PR upgrades `github.com/grafana/dskit` removes Loki's dependency on
`github.com/weaveworks/common`.

The changes in dskit, apart from the migration
(grafana/dskit#356), are:

* grafana/dskit#347 
* grafana/dskit#349, which required small
changes in `pkg/canary/reader/reader.go` and `pkg/canary/writer/push.go`
* grafana/dskit#352
* grafana/dskit#354

**Which issue(s) this PR fixes**:

(none)

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [n/a] Documentation added
- [n/a] Tests updated
- [n/a] `CHANGELOG.md` updated
- [n/a] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [n/a] Changes that require user attention or interaction to upgrade
are documented in `docs/sources/setup/upgrade/_index.md`
- [n/a] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)

---------

Co-authored-by: Michel Hollands <[email protected]>
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.

PATCH requests are being terminated by server
3 participants