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

[processor/resourcedetection] support for periodically do detect action #34959

Closed

Conversation

JaredTan95
Copy link
Member

Description: support for periodically do detect action

Link to tracking Issue: <#34876>

Testing:

Documentation:

@JaredTan95 JaredTan95 requested a review from a team September 2, 2024 13:53
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Sep 2, 2024
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
defer intervalTicker.Stop()

var err error
for range intervalTicker.C {
Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Contributor

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.
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
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)
Copy link
Contributor

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?

Copy link
Contributor

github-actions bot commented Oct 3, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Oct 3, 2024
@JaredTan95 JaredTan95 removed the Stale label Oct 6, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Oct 20, 2024
Copy link
Contributor

github-actions bot commented Nov 3, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/resourcedetection Resource detection processor Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants