You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the registration to use ‘AddTransient’ metohod instead of ‘AddInterceptor’, the object ‘LiquidElasticApmInterceptor’ is not called during the lifecycle of the execution which causes the log to be incomplete, changing the registration method fixes the problem.
The text was updated successfully, but these errors were encountered:
A better way to solve problem is inject interceptor using telemetry injection methods from Liquid.Core : services.AddTransientLiquidTelemetry<ILiquidProducer, ServiceBusProducer>(); because
for the perfect functioning of the interceptor you must create a proxy based on the service you want to intercept, and the mentioned method already performs this function.
Looking inside the ‘AddTransientLiquidTelemetry’ method, it is using ‘services.AddInterceptor();’, this ‘AddInterceptor’, is adding the interceptor using ‘services.TryAddTransient(typeof(IAsyncInterceptor), typeof(TInterceptor));’ which when called won’t add the interceptor a second time, according to the documentation ‘ServiceCollectionDescriptorExtensions.TryAddTransient Method (Microsoft.Extensions.DependencyInjection.Extensions) | Microsoft Docs’
hence the need to use ‘AddTransient’, considering that the proxies are already been generated by the telemetry, I am not seeing any benefits in using this method, what is the recommendation is this case?
oh yes, i see you need to inject the "LiquidElasticApmInterceptor" and the method I mentioned, injects the "LiquidTelemetryInterceptor".
In this case it will be necessary to recreate the behavior (creation of the proxy) inside your method, because without this the interceptor will not work correctly.
Change the registration to use ‘AddTransient’ metohod instead of ‘AddInterceptor’, the object ‘LiquidElasticApmInterceptor’ is not called during the lifecycle of the execution which causes the log to be incomplete, changing the registration method fixes the problem.
The text was updated successfully, but these errors were encountered: