microsoft / ApplicationInsights-SDK-Labs

Application Insights experimental projects repository
MIT License
61 stars 48 forks source link

Binding problem with ClientTelemetry #124

Closed mlooise closed 7 years ago

mlooise commented 7 years ago

Hi All,

I've stubled upon a problem with the clientTelemetry Extension in the WCF extension (Microsoft.ApplicationInsights.Wcf.ClientTelemetryExtensionElement). This extension seems to completely loose the timouts on a binding that have been pre-configured through e.g. the web.config. What i have discovered is that somewhere in the code (in ClientTelemetryEndpointBehavior.cs, AddBindingParameters) A completely new binding is created with no timout info. I would like to change this to not loose this information ... Something like;


            endpoint.Binding = new CustomBinding(collection);
            endpoint.Binding = new CustomBinding(collection)
            {
                OpenTimeout = endpoint.Binding.OpenTimeout,
                CloseTimeout = endpoint.Binding.CloseTimeout,
                ReceiveTimeout = endpoint.Binding.ReceiveTimeout,
                SendTimeout = endpoint.Binding.SendTimeout,
                Name = endpoint.Binding.Name,
                Namespace = endpoint.Binding.Namespace
            };

I have done this on my local repo and created my own local nuget package. I would like to contribute but I am not allowed. @tomasr Could you have a look and maybe allow me to push on some branch?

Regards, Martin

tomasr commented 7 years ago

@mlooise Nice catch!

You should be able to submit a pull request for this if interested, I will take a stab at fixing this and adding some tests later today (still have pending to review some things before completing the update to the v2.4 SDK)

tomasr commented 7 years ago

@mlooise Build 0.27.0-build52604 is now out with this fix. Let us know if you find any other issues!