This PR fixes the issue with the issue when the ObservabilityEndpoint instrumentation is not working.
The issue was caused by ByteBuddy patching the default constructor of the endpoint which is forbidden by Spring. So the endpoint is simply discarded during instantiation.
I moved the exporter field update to the start of the export method. It is executed each time but I guess it is ok while it works. I also tried to use a static field instead but it causes issues with ExportMethodAdvice class availability outside of the agent class loader.
This PR fixes the issue with the issue when the
ObservabilityEndpoint
instrumentation is not working. The issue was caused by ByteBuddy patching the default constructor of the endpoint which is forbidden by Spring. So the endpoint is simply discarded during instantiation.I moved the
exporter
field update to the start of theexport
method. It is executed each time but I guess it is ok while it works. I also tried to use a static field instead but it causes issues withExportMethodAdvice
class availability outside of the agent class loader.