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

use grpc for communicating with compactor for query time filtering of data requested for deletion #7804

Merged
merged 5 commits into from
Nov 30, 2022

Conversation

sandeepsukhani
Copy link
Contributor

@sandeepsukhani sandeepsukhani commented Nov 29, 2022

What this PR does / why we need it:
Add grpc support to compactor for getting delete requests and gen number for query time filtering.
Since these requests are internal to Loki, it would be good to use grpc instead of HTTP same as all the internal requests we do in Loki.

I have added a new config for accepting the grpc address of the compactor. I tried having just the existing config and detecting if it is a grpc server, but it was hard to do it reliably, considering the different deployment modes we support. I think it is safe to keep it the same and eventually deprecate the existing config.

Checklist

  • Documentation added
  • Tests updated
  • CHANGELOG.md updated

@periklis
Copy link
Collaborator

@sandeepsukhani You are addressing this issue btw: #7595

Copy link
Contributor

@MasslessParticle MasslessParticle left a comment

Choose a reason for hiding this comment

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

This looks good. Nice work!

Copy link
Collaborator

@periklis periklis left a comment

Choose a reason for hiding this comment

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

Looks also good to me

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Nov 30, 2022
@sandeepsukhani sandeepsukhani enabled auto-merge (squash) November 30, 2022 08:02
@@ -713,7 +713,7 @@ func (t *Loki) supportIndexDeleteRequest() bool {
func (t *Loki) compactorAddress() (string, bool, error) {
if t.Cfg.isModuleEnabled(All) || t.Cfg.isModuleEnabled(Read) {
// In single binary or read modes, this module depends on Server
return fmt.Sprintf("127.0.0.1:%d", t.Cfg.Server.GRPCListenPort), true, nil
return fmt.Sprintf("%s:%d", t.Cfg.Server.HTTPListenAddress, t.Cfg.Server.GRPCListenPort), true, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Sprintf("%s:%d", t.Cfg.Server.HTTPListenAddress, t.Cfg.Server.GRPCListenPort), true, nil
return fmt.Sprintf("%s:%d", t.Cfg.Server.GRPCListenAddress, t.Cfg.Server.GRPCListenPort), true, nil

Did you mean GRPC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, sorry, my bad, messed up while merging conflicts. Thanks for noticing it and pointing it out!

@sandeepsukhani sandeepsukhani merged commit 1410808 into grafana:main Nov 30, 2022
sandeepsukhani added a commit that referenced this pull request Nov 30, 2022
**What this PR does / why we need it**:
I had enabled auto-merge in PR #7804, but somehow it still merged the PR
without all the checks passing.
This PR fixes the failing lint and tests.
Abuelodelanada pushed a commit to canonical/loki that referenced this pull request Dec 1, 2022
… data requested for deletion (grafana#7804)

**What this PR does / why we need it**:
Add grpc support to compactor for getting delete requests and gen number
for query time filtering.
Since these requests are internal to Loki, it would be good to use grpc
instead of HTTP same as all the internal requests we do in Loki.

I have added a new config for accepting the grpc address of the
compactor. I tried having just the existing config and detecting if it
is a grpc server, but it was hard to do it reliably, considering the
different deployment modes we support. I think it is safe to keep it the
same and eventually deprecate the existing config.

**Checklist**
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
Abuelodelanada pushed a commit to canonical/loki that referenced this pull request Dec 1, 2022
**What this PR does / why we need it**:
I had enabled auto-merge in PR grafana#7804, but somehow it still merged the PR
without all the checks passing.
This PR fixes the failing lint and tests.
@trevorwhitney trevorwhitney added the backport release-2.7.x add to a PR to backport it into release 2.7.x label Dec 9, 2022
@grafanabot
Copy link
Collaborator

The backport to release-2.7.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-7804-to-release-2.7.x origin/release-2.7.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 1410808ee9f20917476fabaa78aa8849ba7c7d20
# Push it to GitHub
git push --set-upstream origin backport-7804-to-release-2.7.x
git switch main
# Remove the local backport branch
git branch -D backport-7804-to-release-2.7.x

Then, create a pull request where the base branch is release-2.7.x and the compare/head branch is backport-7804-to-release-2.7.x.

@trevorwhitney trevorwhitney mentioned this pull request Dec 9, 2022
3 tasks
trevorwhitney pushed a commit to trevorwhitney/loki that referenced this pull request Dec 9, 2022
… data requested for deletion (grafana#7804)

**What this PR does / why we need it**:
Add grpc support to compactor for getting delete requests and gen number
for query time filtering.
Since these requests are internal to Loki, it would be good to use grpc
instead of HTTP same as all the internal requests we do in Loki.

I have added a new config for accepting the grpc address of the
compactor. I tried having just the existing config and detecting if it
is a grpc server, but it was hard to do it reliably, considering the
different deployment modes we support. I think it is safe to keep it the
same and eventually deprecate the existing config.

**Checklist**
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated

(cherry picked from commit 1410808)
trevorwhitney pushed a commit to trevorwhitney/loki that referenced this pull request Dec 9, 2022
**What this PR does / why we need it**:
I had enabled auto-merge in PR grafana#7804, but somehow it still merged the PR
without all the checks passing.
This PR fixes the failing lint and tests.
trevorwhitney added a commit that referenced this pull request Dec 9, 2022
use grpc for communicating with compactor for query time filtering of
data requested for deletion (#7804)

Manual backport of #7804 and #7814

**What this PR does / why we need it**:
Add grpc support to compactor for getting delete requests and gen number
for query time filtering.
Since these requests are internal to Loki, it would be good to use grpc
instead of HTTP same as all the internal requests we do in Loki.

I have added a new config for accepting the grpc address of the
compactor. I tried having just the existing config and detecting if it
is a grpc server, but it was hard to do it reliably, considering the
different deployment modes we support. I think it is safe to keep it the
same and eventually deprecate the existing config.

**Checklist**
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated

(cherry picked from commit 1410808)

Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
JoaoBraveCoding added a commit to JoaoBraveCoding/loki that referenced this pull request Mar 21, 2023
Problem: in grafana#7804 the possibility to
use gRPC for communicating with compactor for query time filtering of
data requested for deletion was added, however the loki mixin still generates
the compactor service without a gRPC port.

Solution: make the compactor service/deployment expose both a HTTP and
gRPC port.

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
chaudum pushed a commit that referenced this pull request Mar 21, 2023
**What this PR does / why we need it**:

Problem: in #7804 the possibility to use gRPC for communicating with the compactor for query time filtering of data requested for deletion was added, however, the Loki mixin still generates the compactor service without a gRPC port.

Solution: make the compactor service/deployment expose both an HTTP and gRPC port.

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-2.7.x add to a PR to backport it into release 2.7.x backport-failed size/XXL type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants