Example #1
0
        public static void CustomRequestAttributeSample()
        {
            // we're using the incoming remote call tracer as an example for an active service call
            IIncomingRemoteCallTracer incomingRemoteCallTracer = SampleApplication.OneAgentSdk
                                                                 .TraceIncomingRemoteCall("RemoteMethod", "RemoteServiceName", "mrcp://endpoint/service");

            incomingRemoteCallTracer.Trace(() =>
            {
                // do processing ...

                // set custom request attributes
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("region", "EMEA");            // string value
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("salesAmount", 2500);         // long value
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("service-quality", 0.707106); // double value

                // set multiple values for same key
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("account-group", 1);
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("account-group", 2);
                SampleApplication.OneAgentSdk.AddCustomRequestAttribute("account-group", 3);
            });
        }