-
Notifications
You must be signed in to change notification settings - Fork 936
chore(otl-exporter-base): make _delegate
protected
#5918
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
base: main
Are you sure you want to change the base?
Conversation
01b8716
to
a5e4511
Compare
a5e4511
to
50e275e
Compare
This was the intention. We're trying to get completely away from allowing the sub classing of exporters. The state of the exporters about a year ago was so dire as everything was public/protected that we were not able to make even small changes anymore without breaking someone. This made fixing bugs virtually impossible. I strongly oppose exposing more than what's needed for this reason. Maybe we can work something else out that would benefit both the project and you? Can you provide some details to what you're trying to achieve? |
I thought that was the reason. I maintain the We have currently three reasons to extend exporters: Right now, we have three main reasons for extending exporters:
|
Another use case is reacting to status codes. For example, we have some rate limiting in place and need to handle the 429 error code, so hooking into the send method makes sense for us. Some of the things mentioned above could be implemented directly in OTel , but others are product-specific. In those cases, having hooks or the ability to override methods seems reasonable to me. |
Looking at the use-cases, it looks to me like none of them would actually benefit from having the actual OTLP exporter as a base class. It looks to me that many of these can be solved via composition and using the That should give you a way to accomplish the following by intercepting the
If you add some code after passing it to the underlying exporter (in the callback), then you should also be able to do:
As for handling |
Adding the 429 use case
What other options do we have if we want the underline http status code? Thanks! |
I see what you're trying to accomplish, but I fail to see how this change here would move the needle significantly towards you accomplishing your goals. From my POV this PR reduces the need for you to have around 20 lines of boilerplate code, but does not move you any closer towards what you're telling me that you're actually trying to do. |
So what I'm trying to avoid is merging a PR that expands our public interface but still ends up being for nothing in the end. |
@pichlermarc |
@oreporan please open an issue or link it here if it already exists - ideally with information of what exactly the handling is that you're looking for. 🙂 In the past, we've added features to the exporters without much discussion about how features are supposed to be used by the end-users. This made us end up with a lot of bloat in the exporters that made development extremely difficult. I want to help, but we need to sort out the requirements first, so that me and other @open-telemetry/javascript-approvers to adequately review the contents of a PR - looking at this PR here I don't see the full picture yet and I feel like I'm missing a whole lot of context about how the PR helps with achieving a goal, which is the reason I cannot even suggest any notable improvements or alternatives. A side note: usually an implementation of |
Which problem is this PR solving?
We are extending the OTLExporter functionality and need to access the delegate property. However, this property is currently private and not exposed to the derived class, which prevents us from using it.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
N/A
Checklist: