Skip to content

fix: make helm use grpc for compactor address #17454

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

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

Conversation

rurod
Copy link

@rurod rurod commented Apr 25, 2025

What this PR does / why we need it:
Align the computation logic of the compactor address with how other address are computed.
Moreover, it makes use of grpc, as according to the Loki codebase, it's the preferred way :
https://github.com/grafana/loki/blob/46b2271aacd26734979667da61d5c9d24a8efb2b/pkg/loki/modules.go#L1256C1-L1274C2

Which issue(s) this PR fixes:
Kind of fixes #17100, as using the full hostname of the service rather than the short name helps comply with the no_proxy instruction, even if not mandatory

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
@rurod rurod requested a review from a team as a code owner April 25, 2025 14:28
@jkroepke
Copy link
Contributor

jkroepke commented Jun 30, 2025

Hi @rurod I looked into the code where loki.compactorAddress is used.

It is used in

commonConfig:
path_prefix: /var/loki
replication_factor: 3
compactor_address: '{{ include "loki.compactorAddress" . }}'

and according docs, compactor_address requires and address in http://address:port format. (https://grafana.com/docs/loki/latest/configure/#common_config). In any case, define gRPC port here should not work.

@rurod
Copy link
Author

rurod commented Jun 30, 2025

Hi @jkroepke, thanks for having a look at my PR and catching this.

What do you think about replacing the compactor_address parameter by the compactor_grpc_address one in the configuration template?

Is there any specific reason to use http for the compacto rather than grpc ?

@jkroepke
Copy link
Contributor

Is there any specific reason to use http for the compacto rather than grpc ?

Looking through the git history, I cant find any valid reason.

However, I found #7804 which advertise gRPC over HTTP.

Generally, I would say that the Helm chart should prefer gRPC as well.
However, this would result in a theoretical breaking change, because any user-defined value for compactor_address would then be ignored.
If both are defined, Loki prioritizes the compactor_grpc_address value.

But I feel that the theoretical breaking change is an edge which can be covered by an fair warning in https://github.com/grafana/loki/blob/main/production/helm/loki/CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants