-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/resourcedetection] support for periodically do detect action #34959
[processor/resourcedetection] support for periodically do detect action #34959
Conversation
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
119238e
to
f02b220
Compare
defer intervalTicker.Stop() | ||
|
||
var err error | ||
for range intervalTicker.C { |
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.
how is this loop exited?
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.
This is an infinite loop that receives the timer's signal through the intervalTicker.C channel. Whenever the timer fires, the channel intervalTicker.C sends a time value.
Therefore, as long as the otel process does not exit, it will continue to execute periodically.
Do we need to add a flag so that users can configure when to exit?
rdp.resource, rdp.schemaURL, err = rdp.provider.Get(ctx, client) | ||
|
||
if rdp.detectInterval > 0 { | ||
go rdp.tickerDetect(ctx, client) |
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.
please make sure stop closes this coroutine to avoid leaks
component: resourcedetectionprocessor | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: support for periodically do detect action. |
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.
note: support for periodically do detect action. | |
note: add support to refreshing the resource provider performing detection. |
|
||
var err error | ||
for range intervalTicker.C { | ||
rdp.resource, rdp.schemaURL, err = rdp.provider.Get(ctx, client) |
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.
is it safe to reassign without locks?
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description: support for periodically do detect action
Link to tracking Issue: <#34876>
Testing:
Documentation: