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

Fix logs cluster #1716

Merged
merged 9 commits into from
Oct 3, 2024
Merged

Fix logs cluster #1716

merged 9 commits into from
Oct 3, 2024

Conversation

mattdurham
Copy link
Collaborator

PR Description

The loki.source.kubernetes component uses the default clustering approach. Which adds things like ports, addresses and other things. When in reality we only care about 4 fields to uniquely identify a log location. This can cause duplication of log pulling. This limits the labels to the only ones that uniquely identify a log. This is copied by how the actual tailer deduplicates targets, unfortunately that comes after the cluster figures out how to allocate logs.

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Tests updated

@mattdurham mattdurham requested a review from a team as a code owner September 19, 2024 15:01
@mattdurham mattdurham enabled auto-merge (squash) September 23, 2024 14:26
Copy link
Contributor

@ptodev ptodev left a comment

Choose a reason for hiding this comment

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

Should we update the docs to clarify how the feature works?

internal/component/discovery/distributed_targets.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Oct 3, 2024
@@ -145,6 +145,20 @@ If {{< param "PRODUCT_NAME" >}} is _not_ running in clustered mode, then the blo
`loki.source.kubernetes` collects logs from every target it receives in its
arguments.

Clustering only looks at the following labels for determining the shard key:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Clustering only looks at the following labels for determining the shard key:
Clustering looks at the following labels for determining the shard key:

I think we can drop the only here.

@mattdurham mattdurham merged commit 2c329de into grafana:main Oct 3, 2024
15 of 17 checks passed
ptodev pushed a commit that referenced this pull request Oct 4, 2024
* fix clustering for logs

* Simplify code.

* Add changelog.
ptodev pushed a commit that referenced this pull request Oct 4, 2024
* fix clustering for logs

* Simplify code.

* Add changelog.
ptodev added a commit that referenced this pull request Oct 4, 2024
…SION file (#1828)

* chore: bump yet-another-cloudwatch-exporter to v0.61.0 (#1690)

* chore: bump yet-another-cloudwatch-exporter to v0.61.0

This bumps yet-another-cloudwatch-exporter to v0.61.0, which fixes [an issue with S3 metrics being reported as `NaN`](nerdswords/yet-another-cloudwatch-exporter#728).

Affected metrics have a value of `0` in the scraped prometheus metrics. With the update to v0.61.0, they are reported correctly.

* fixup! chore: bump yet-another-cloudwatch-exporter to v0.61.0

JobLevelMetricFields has been removed with nerdswords/yet-another-cloudwatch-exporter#1412

* fixup! chore: bump yet-another-cloudwatch-exporter to v0.61.0

* Update windows_exporter to v0.27.3 (#1785)

* Update windows_exporter to v0.27.3

Signed-off-by: Jan-Otto Kröpke <[email protected]>

* Update windows_exporter to v0.27.3

Signed-off-by: Jan-Otto Kröpke <[email protected]>

---------

Signed-off-by: Jan-Otto Kröpke <[email protected]>

* build(deps): bump webpack from 5.82.1 to 5.94.0 in /internal/web/ui (#1594)

Bumps [webpack](https://github.com/webpack/webpack) from 5.82.1 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.82.1...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump rollup from 2.79.1 to 2.79.2 in /internal/web/ui (#1775)

Bumps [rollup](https://github.com/rollup/rollup) from 2.79.1 to 2.79.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.79.1...v2.79.2)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 1687 otelcol.exporter.awss3 config fixes (#1791)

* Address loki.process config reloads (#1809)

* Fix logs cluster (#1716)

* fix clustering for logs

* Simplify code.

* Add changelog.

* Reorder changelog

* Update VERSION

---------

Signed-off-by: Jan-Otto Kröpke <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: morre <[email protected]>
Co-authored-by: Jan-Otto Kröpke <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: cydergoth <[email protected]>
Co-authored-by: Piotr <[email protected]>
Co-authored-by: mattdurham <[email protected]>
pbailhache pushed a commit to pbailhache/alloy that referenced this pull request Oct 17, 2024
* fix clustering for logs

* Simplify code.

* Add changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants