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

add tracking and comparison of latest healthy content before loading a module #5054

Merged
merged 4 commits into from
Sep 1, 2023

Conversation

erikbaranowski
Copy link
Contributor

PR Description

Which issue(s) this PR fixes

Fixes #5028

Notes to the Reviewer

PR Checklist

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

…a module

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
CHANGELOG.md Show resolved Hide resolved
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
func (c *ModuleComponent) LoadFlowContent(args map[string]any, contentValue string) error {
if contentValue == c.getLatestContent() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to check args also?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking of if an argument with a default was not specified and then the argument was added and the content is the same.

Copy link
Member

Choose a reason for hiding this comment

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

This sounds right to me, LoadFlowContent should be a no-op if both the content or the args change. If either of them changed, then it should go through.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattdurham, take a peek at what I did in the latest. I'm a little uncomfortable with the arguments being a map[string]any for correct comparison in all cases. do you think we need to do something more significant in how arguments are handled or do you think this covers it for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That should work, since DeepEqual errs on the side of return false.

@erikbaranowski erikbaranowski marked this pull request as ready for review August 31, 2023 18:57
@erikbaranowski erikbaranowski requested a review from a team as a code owner August 31, 2023 18:57
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

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

LGTM % Matt's comment that needs to be resolved.

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

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

LGTM

@erikbaranowski erikbaranowski merged commit 597bb6b into main Sep 1, 2023
8 checks passed
@erikbaranowski erikbaranowski deleted the module.git-5028 branch September 1, 2023 13:35
erikbaranowski added a commit that referenced this pull request Sep 5, 2023
…a module (#5054)

* add tracking and comparison of latest healthy content before loading a module
* add tracking and check for arguments in module loaders

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
(cherry picked from commit 597bb6b)
erikbaranowski added a commit that referenced this pull request Sep 6, 2023
* add tracking and comparison of latest healthy content before loading a module (#5054)

* add tracking and comparison of latest healthy content before loading a module
* add tracking and check for arguments in module loaders

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
(cherry picked from commit 597bb6b)

* add changelog version header

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* fix(http): allow override default user-agent header for http.remote (#5059)

(cherry picked from commit 1eb5817)

* fix(agentctl): prevent panic when validating integration-included cfg file (#5070)

* fix(agentctl): prevent panic when validating integration-included cfg file
Also add unit tests to prevent regression

* doc(changelog): add new BUGFIXES entry

(cherry picked from commit acc06f6)

* loki.process: fix deadlock in case of frequent updates (#5065)

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
(cherry picked from commit 501cf69)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* loki.process: make deadlock test condition less sensitive (#5096)

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
(cherry picked from commit 7b15144)

* integrations/eventhandler: remove double-logging of events (#5100)

This removes the info-level log line indicating that an event is logged.
When agent logs are being collected, this makes the event appear as if
it was double-collected, as the event appears both in the logs sent
directly to Loki and in the agent logs.

(cherry picked from commit 276355e)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* Operator: update default reloader version

* misc: use github.com/grafana/river (#4949)

(cherry picked from commit 9a12485)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* add more complete river identifier validation and sanitization (#4998)

* use river functions to validate and sanitize river identifiers

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
(cherry picked from commit ce3fe1c)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* Converter fix identifiers (#5102)

* catch some places missing river label sanitization

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
(cherry picked from commit 6991ff2)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* refactor promtail converter sd configs so they reuse prometheus conve… (#5069)

* refactor promtail converter sd configs so they reuse prometheus converter functionality

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* cleanup words

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* unexport a bunch of stuff that isn't needed outside the prometheusconvert package

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* don't do SD targets in backwards order during converter

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* get rid of static SD boilerplate

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
Co-authored-by: Piotr Gwizdala <17101802+thampiotr@users.noreply.github.com>
(cherry picked from commit 89b334e)

* update test for older go version ordering

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

* Add a couple more unsupported fields to the prometheus converter

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>

---------

Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Co-authored-by: Đỗ Trọng Hải <41283691+hainenber@users.noreply.github.com>
Co-authored-by: Paschalis Tsilias <tpaschalis@users.noreply.github.com>
Co-authored-by: Robert Fratto <robertfratto@gmail.com>
Co-authored-by: Craig Peterson <192540+captncraig@users.noreply.github.com>
@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 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 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.

module.git should not reload flow components every time it polls
3 participants