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

Implement Backoff in a generic way #11490

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bogdandrutu
Copy link
Member

No description provided.

Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 75 lines in your changes missing coverage. Please review.

Project coverage is 91.19%. Comparing base (ba4ab80) to head (778a528).
Report is 63 commits behind head on main.

Files with missing lines Patch % Lines
config/configretry/backoff.go 0.00% 66 Missing ⚠️
config/configretry/throttle_retry.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11490      +/-   ##
==========================================
- Coverage   91.48%   91.19%   -0.29%     
==========================================
  Files         433      434       +1     
  Lines       23617    23692      +75     
==========================================
  Hits        21607    21607              
- Misses       1642     1717      +75     
  Partials      368      368              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"errors"

"go.opentelemetry.io/collector/consumer/internal"
)

type ConsumeFunc[T any] func(context.Context, T) error
Copy link
Member

Choose a reason for hiding this comment

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

Are concerns from #7051 (comment) still relevant with this design?

Choose a reason for hiding this comment

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

No, because we don't change the interface (you can see that I did not change any consumer). Also, if I understand correctly my change is backwards compatible (not breaking change) and equivalent with the previous code, except I extract the common ConsumeFunc. This only hints users that they can implement this instead of every function if their logic is signal agnostic.

Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Should this block #11492?

@sfc-gh-bdrutu
Copy link

Should this block #11492?

I think my change is not a breaking change, unless I am missing something. Would be good to understand if you would call this a breaking change, and how would I validate it in the future.

@mx-psi
Copy link
Member

mx-psi commented Oct 21, 2024

I agree it is not. We were discussing if the type change from func(...) to the ConsumeFunc is a breaking change, but I don't think it is, I believe implicit casting happens everywhere (example)

@sfc-gh-bdrutu
Copy link

@mx-psi I don't mind waiting for this small change (adding the generic helper func) before stabilizing consumer to be 100% safe. I want first feedback if this improves our story.

Copy link
Contributor

github-actions bot commented Nov 5, 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 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants