-
Notifications
You must be signed in to change notification settings - Fork 39
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
Please do not remove the option to set a TraceExporterStub on TraceExporter via builder #277
Comments
@psx95 can you take a look at this? |
Hi @lkleeven, Thank you for your request. I looked into this request and I think it would be better if you do not depend on our stub client directly for unit testing. Instead, I would recommend using the InMemorySpanExporter to verify the span attributes set by your application. This seems to be the recommended solution by the OpenTelemetry community for testing your application's OTel integration. I have a sample PR that demonstrates the use of this exporter for unit testing. I understand that this might mean that you are not able to verify the span attributes set by the Google Cloud's Is there any particular reason you are verifying the attributes set by the |
The reason we also verify the attributes set by the I understand that it's not ideal and if we're the only one depending on it that it won't stop the removal. I think we potentially could change our tests by investigating if we could have it talk to some kind of mocked tracing backend. I'll discuss this with the team. |
Thanks for your feedback @lkleeven. At this time we will not remove the deprecated method. |
We currently rely heavily on the ability to set a
TraceExporterStub
on createdTraceExporter
for our tests. This allows us to check all the attributes set on the spans, including the ones by theTraceExporter
. This way we can quickly spot any regressions in behavior that our own framework, which provides tracing, should act upon. To clarify, this is our Spring Autoconfiguration setup:If this is removed we either loose the ability to check all the spans because we would need to mock the
SpanExporter
and mis all the attributes set by the TraceExporter. Or we would have to set up some kind of mock to accept the calls which would require a lot of rework.With this in mind, could you please reconsider this deprecation/removal, or otherwise provide us with some guidance in how we could properly test this if it is still removed?
The text was updated successfully, but these errors were encountered: