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

Stop using global logger in modules #11051

Merged
merged 13 commits into from Nov 1, 2023
Merged

Conversation

shantanualsi
Copy link
Contributor

@shantanualsi shantanualsi commented Oct 26, 2023

What this PR does / why we need it:
Refactors Loki to inject logger from the constructors instead of using global logger variable. It is generally considered a good practice.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • 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
  • 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.

@shantanualsi shantanualsi changed the title Stop using global logger in ingester Stop using global logger in modules Oct 27, 2023
@shantanualsi shantanualsi marked this pull request as ready for review October 27, 2023 12:12
@shantanualsi shantanualsi requested a review from a team as a code owner October 27, 2023 12:12
Copy link
Contributor

@ashwanthgoli ashwanthgoli left a comment

Choose a reason for hiding this comment

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

lgtm, thank you!

pkg/distributor/distributor.go Outdated Show resolved Hide resolved
pkg/ingester/ingester.go Outdated Show resolved Hide resolved
pkg/storage/stores/series/index/table_manager.go Outdated Show resolved Hide resolved
@ashwanthgoli ashwanthgoli merged commit fb6f6d2 into main Nov 1, 2023
5 checks passed
@ashwanthgoli ashwanthgoli deleted the shantanu/cleanup-global-log branch November 1, 2023 13:55
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
**What this PR does / why we need it**:
Refactors Loki to inject logger from the constructors instead of using
global logger variable. It is generally considered a good practice.

**Which issue(s) this PR fixes**:
[Fixes #<issue
number>](https://github.com/grafana/loki-private/issues/810)

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] 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](grafana@d10549e)
- [ ] 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. <!--
TODO(salvacorts): Add example PR -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants