-
Notifications
You must be signed in to change notification settings - Fork 455
fix: trigger the sync job when targets are updated #4635
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
Conversation
CHANGELOG.md
Outdated
|
|
||
| - `prometheus.exporter.postgres` dependency has been updated to v0.18.1. This includes new `stat_progress_vacuum` and `buffercache_summary` collectors, as well as other bugfixes and enhancements. (@cristiangreco) | ||
|
|
||
| - `local.file_match` will now trigger it's sync job when the component is updated with new targets. (@kalleep) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit of an implementation detail. I think you want to write a bugfix message on what this fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the local.file_match component to trigger its sync job immediately whenever the component is updated with new targets, rather than only syncing on startup or timer expiration. This improves responsiveness when used with discovery mechanisms by exporting new targets as soon as discovery data changes.
Key changes:
- Introduced a buffered channel to signal target changes and trigger immediate syncs
- Changed from
RWMutextoMutexfor simpler locking semantics - Refactored the Run loop to handle both timer-based and change-triggered syncs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/component/local/file_match/file.go | Added targetsChanged channel to trigger immediate syncs on component updates; refactored Run loop to handle both timer-based and event-driven syncs |
| CHANGELOG.md | Documented the new behavior of triggering sync jobs on component updates |
a46cdd8 to
84c98d2
Compare
84c98d2 to
25824ad
Compare
* fix: trigger the sync job whenever the component is updated with new targets
* fix: trigger the sync job when targets are updated (#4635) * Fix splunkhec arguments missing new block (#4612) * Fix CRD translations to propagate scrape protocols (#4638) * fix: loki source file scheduleloop (#4634) * fix: panic when no tcp block is used for otelcol.receiver.syslog (#4628) * Expose ARP collector config options. (#4669) --------- Co-authored-by: Sam DeHaan <sam.dehaan@grafana.com> Co-authored-by: Paulin Todev <paulin.todev@gmail.com>
PR Description
Extracted from #4611
Before this component would only export new targets whenever it started or if the timer was triggered. When using this component with discovery mechanism it is useful to "expand" paths and exports as soon as we have new discovery data.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist