Example #1
0
        private void ExtractTagsFromCollections(ReportAddedToIncident e, TagIdentifierContext ctx)
        {
            foreach (var collection in e.Report.ContextCollections)
            {
                // Comma seperated tags
                if (collection.Properties.TryGetValue("OneTrueTags", out var tagsStr) &&
                    collection.Properties.TryGetValue("ErrTags", out tagsStr))
                {
                    try
                    {
                        var tags = tagsStr.Split(',');
                        foreach (var tag in tags)
                        {
                            ctx.AddTag(tag, 1);
                        }
                    }
                    catch (Exception ex)
                    {
                        _logger.Error(
                            "Failed to parse tags from '" + collection.Name + "', invalid tag string: '" + tagsStr + "'.",
                            ex);
                    }
                }

                //Tag array
                foreach (var property in collection.Properties)
                {
                    if (property.Key.StartsWith("ErrTags["))
                    {
                        ctx.AddTag(property.Value, 1);
                    }
                }
            }
        }
Example #2
0
        private void ExtractTagsFromCollections(ReportAddedToIncident e, TagIdentifierContext ctx)
        {
            foreach (var collection in e.Report.ContextCollections)
            {
                string tagsStr;
                if (!collection.Properties.TryGetValue("OneTrueTags", out tagsStr))
                {
                    continue;
                }

                try
                {
                    var tags = tagsStr.Split(',');
                    foreach (var tag in tags)
                    {
                        ctx.AddTag(tag, 1);
                    }
                }
                catch (Exception ex)
                {
                    _logger.Error(
                        "Failed to parse tags from '" + collection.Name + "', invalid tag string: '" + tagsStr + "'.",
                        ex);
                }
            }
        }
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            var property = context.GetPropertyValue("Assembly", "Microsoft.CSharp");

            if (property == null)
            {
                return;
            }

            context.AddTag("c#", 99);
            var pos = property.IndexOf(".");

            if (pos != -1)
            {
                context.AddTag("c#-" + property.Substring(pos + 1, 3), 99);
            }
        }
Example #4
0
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }


            context.AddIfFound("System.Web", "http");

            var orderNumber = context.AddIfFound("System.Web.Mvc", "asp.net-mvc");

            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "System.Web.Mvc");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    var version = propertyValue.Substring(0, 1);
                    if (version != "0" && version != "1")
                    {
                        context.AddTag("asp.net-mvc-" + version, orderNumber);
                    }
                }

                context.AddTag("asp.net", 99);
            }

            orderNumber = context.AddIfFound("System.Web.Http.WebHost", "asp.net-web-api");
            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "System.Web.Http.WebHost");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    var version = propertyValue.Substring(0, 1);
                    context.AddTag("asp.net-web-api-" + version, orderNumber);
                }

                context.AddTag("asp.net", 99);
            }
        }
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var propertyValue = context.GetPropertyValue("ExceptionProperties", "Message");

            if (propertyValue != null && propertyValue.Contains(".cshtml"))
            {
                context.AddTag("razor", 0);
            }
        }
        /// <summary>
        ///     Check if the wanted tag is supported.
        /// </summary>
        /// <param name="context">Error context providing information to search through</param>
        public void Identify(TagIdentifierContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var orderNumber = context.AddIfFound("EntityFramework", "entity-framework");

            if (orderNumber != -1)
            {
                var propertyValue = context.GetPropertyValue("Assemblies", "entity-framework");
                if (!string.IsNullOrEmpty(propertyValue))
                {
                    context.AddTag("entity-framework-" + propertyValue.Substring(0, 1), orderNumber);
                }
            }
            var property2 = context.GetPropertyValue("Assemblies", "EntityFramework.SqlServer");

            if (property2 != null)
            {
                context.AddTag("sqlserver", 99);
            }
        }
        /// <inheritdoc />
        public void Identify(TagIdentifierContext context)
        {
            var name = GetVersionAssemblyName(context.ApplicationId);

            if (name == null)
            {
                return;
            }

            var version = context.GetPropertyValue("Assemblies", name);

            if (version != null)
            {
                context.AddTag("v" + version, 1);
            }
        }