Closed
Description
Component(s)
extension/oauth2clientauth
Is your feature request related to a problem? Please describe.
There is a risk that the oauth token expired right after the request being sent and causing a data loss.
Describe the solution you'd like
Add a config for expiry buffer. The change would be like replace the ReuseTokenSource with ReuseTokenSourceWithExpiry and add a config for the expiry. Optional to provide a default expiry buffer
ref:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/oauth2clientauthextension/clientcredentialsconfig.go#L93
https://pkg.go.dev/golang.org/x/oauth2#ReuseTokenSourceWithExpiry
Describe alternatives you've considered
No response
Additional context
No response