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

converters: Default with localhost in static targets when none provided #5546

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

thampiotr
Copy link
Contributor

@thampiotr thampiotr commented Oct 19, 2023

PR Description

Promtail adds some defaults added to static targets configuration at runtime here: https://github.com/grafana/loki/blob/4a564456861c0ab7441b815aa49a7c0f22a05f4c/clients/pkg/promtail/targets/file/filetargetmanager.go#L102

We were not doing this in config converters, which led to incorrect configs, e.g. #5447

Which issue(s) this PR fixes

Fixes #5447

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

Sorry, something went wrong.

@thampiotr thampiotr force-pushed the thampiotr/add-localhost-to-targets branch from 87209b5 to c7006dc Compare October 20, 2023 11:08
@thampiotr thampiotr changed the title promtail: Default with localhost in static targets in converter converters: Default with localhost in static targets when none provided Oct 20, 2023
Comment on lines +113 to +114
// Add source and default 'localhost' target to match Promtail's behaviour.
// See https://github.com/grafana/loki/blob/4a564456861c0ab7441b815aa49a7c0f22a05f4c/clients/pkg/promtail/targets/file/filetargetmanager.go#L102
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thampiotr thampiotr marked this pull request as ready for review October 20, 2023 11:34
@thampiotr thampiotr requested a review from a team as a code owner October 20, 2023 11:34
Copy link
Contributor

@erikbaranowski erikbaranowski left a comment

Choose a reason for hiding this comment

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

LGTM

@thampiotr thampiotr merged commit 8850660 into main Oct 20, 2023
@thampiotr thampiotr deleted the thampiotr/add-localhost-to-targets branch October 20, 2023 14:51
tpaschalis pushed a commit to tpaschalis/agent that referenced this pull request Oct 25, 2023
…ed (grafana#5546)

* promtail: Default with localhost in static targets in converter

* Add tests and changelog

* prettify

* feedback

(cherry picked from commit 8850660)
tpaschalis added a commit that referenced this pull request Oct 26, 2023
* go get google.golang.org/[email protected] (#5511)

(cherry picked from commit 1d11d37)

* Upgrade Agent to Collector 0.87 (#5529)

* Upgrade Agent to Collector 0.87

* Parametrize the OTel version in docs.

* Document another batch processor metric

* Don't accept routing keys for metrics.

* Add tests for otelcol.receiver.kafka

---------

Co-authored-by: Mischa Thompson <[email protected]>
(cherry picked from commit b307c02)

* prometheus.remote_write: fix missing series ref mapping for native histogram (#5517)

Signed-off-by: György Krajcsovits <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
(cherry picked from commit 5794224)

* pkg/metrics/wal: drop out-of-order exemplars (#5580)

Signed-off-by: Paschalis Tsilias <[email protected]>
(cherry picked from commit cd9d185)

* remote.vault: respect value of `namespace` argument (#5582)

Unfortunately, this setting can't be easily tested because Vault
namespaces are an enterprise-only feature.

Co-authored-by: Paschalis Tsilias <[email protected]>
(cherry picked from commit c0a52bc)

* reorganize prometheus converter code and limit surface area of dependencies between converters (#5406)

Signed-off-by: erikbaranowski <[email protected]>
(cherry picked from commit 5d39145)

* Clearer converter diagnostics (#5505)

* Update a bunch of converter messages and use standardized functions where possible for validation.

* default promtail log level from static converter so warnings don't show

* update migration doc output to match current behaviour

* refactor validation helper functions

Signed-off-by: erikbaranowski <[email protected]>

---------

Signed-off-by: erikbaranowski <[email protected]>
(cherry picked from commit 06c6792)

* wire up the agent integration for the static converter (#5545)

* wire up the agent integration for the static converter

Signed-off-by: erikbaranowski <[email protected]>

---------

Signed-off-by: erikbaranowski <[email protected]>
(cherry picked from commit f4e6ac4)

* converters: Default with localhost in static targets when none provided (#5546)

* promtail: Default with localhost in static targets in converter

* Add tests and changelog

* prettify

* feedback

(cherry picked from commit 8850660)

---------

Co-authored-by: Mischa Thompson <[email protected]>
Co-authored-by: Paulin Todev <[email protected]>
Co-authored-by: George Krajcsovits <[email protected]>
Co-authored-by: Robert Fratto <[email protected]>
Co-authored-by: Erik Baranowski <[email protected]>
Co-authored-by: Piotr <[email protected]>
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to Convert a Static Mode Logs Config to Flow Mode Automatically
2 participants