Пример #1
0
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     if (MySyntheticCheck(HttpContext.Current.Request))
     {
         telemetry.Context.Operation.SyntheticSource = "MySyntheticSource";
     }
 }
Пример #2
0
        public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
        {
            telemetry.Context.Properties["device.family"] = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily;

            // AppInsights *always* sets Device.Type to "Phone" for a UWP application.  Override with
            // a more useful value.
            switch (telemetry.Context.Properties["device.family"])
            {
            case "Windows.Desktop":
                telemetry.Context.Device.Type = "PC";
                break;

            case "Windows.Mobile":
                telemetry.Context.Device.Type = "Phone";
                break;

            case "Windows.IoT":
                telemetry.Context.Device.Type = "IoT";
                break;

            default:
                telemetry.Context.Device.Type = "Other";
                break;
            }
        }
 /// <summary>
 /// Initializes the given <see cref="T:Microsoft.ApplicationInsights.Channel.ITelemetry"/>.
 /// </summary>
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     if (telemetry != null && telemetry.Context != null)
     {
         if (String.IsNullOrWhiteSpace(telemetry.Context.Device.OperatingSystem))
         {
             telemetry.Context.Device.OperatingSystem = _osVersion.Value;
         }
     }
 }
 /// <summary>
 /// Initializes the given <see cref="T:Microsoft.ApplicationInsights.Channel.ITelemetry"/>.
 /// </summary>
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     if (telemetry != null && telemetry.Context != null)
     {
         if (String.IsNullOrWhiteSpace(telemetry.Context.Component.Version))
         {
             telemetry.Context.Component.Version = _applicationVersion;
         }
     }
 }
        public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
        {
            var requestTelemetry = telemetry as RequestTelemetry;

            if (requestTelemetry == null)
            {
                return;
            }

            requestTelemetry.Properties.Add("TestException", "TestProject");

            telemetry.Context.Cloud.RoleInstance = this._roleName;
            telemetry.Context.Cloud.RoleName     = this._roleName;
        }
Пример #6
0
    public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
    {
        var context = HttpContext.Current;

        if (context == null)
        {
            return;
        }
        // If user has authenticated, add a property UserID to telemetry which will have
        //  * domain\\username for Windows Authentication
        //  * [email protected] for Azure AD Authentication
        if (context.User.Identity.IsAuthenticated)
        {
            telemetry.Context.Properties["UserID"] = context.User.Identity.Name;
        }
        else
        {
            telemetry.Context.Properties["UserID"] = "Null";
        }
    }
Пример #7
0
        public void Process(Microsoft.ApplicationInsights.Channel.ITelemetry item)
        {
            if (item is DependencyTelemetry dependencyTelemetry)
            {
                if (dependencyTelemetry.Name == "AcceptMessageSession")
                {
                    return;
                }
                if (dependencyTelemetry.Type == "AcceptMessageSession")
                {
                    return;
                }
                if (dependencyTelemetry.Properties.ContainsKey("Outgoing Command") && dependencyTelemetry.Properties["Outgoing Command"] == "AcceptMessageSession")
                {
                    return;
                }
                if (dependencyTelemetry.Type == "Azure Service Bus")
                {
                    return;
                }
                // only log table storage writes over 1 second in duration
                if (dependencyTelemetry.Type == "Azure table" && dependencyTelemetry.Duration.TotalSeconds < 1)
                {
                    return;
                }
            }

            if (item is ExceptionTelemetry exceptionTelemetry)
            {
                // these happen every 60 seconds on AcceptMessageSession and should be ignored
                if (exceptionTelemetry.ExceptionDetailsInfoList.Count > 0 &&
                    exceptionTelemetry.ExceptionDetailsInfoList[0].TypeName == "Microsoft.Azure.ServiceBus.ServiceBusTimeoutException")
                {
                    return;
                }
            }

            _next.Process(item);
        }
Пример #8
0
 public Microsoft.ApplicationInsights.Channel.ITelemetry SetTelemetryInitialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     //here you can tweak telemetry items before they are logged.
     //if you don't know anything about logging or telemetry, just return the object
     return(telemetry);
 }
Пример #9
0
 void ITelemetryInitializer.Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     telemetry.Context.Cloud.RoleName = "Parts Unlimited";
 }
Пример #10
0
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     //telemetry.Context.Operation.Id = CommandContext.CorrelationKey ?? telemetry.Context.Operation.Id;
 }
Пример #11
0
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     telemetry.Context.Cloud.RoleName     = _roleName;
     telemetry.Context.Cloud.RoleInstance = _roleName;
 }
 public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
 {
     telemetry.Context.[some field] = [some value];