I'll try putting services.AddApplicationInsightsTelemetry(); in front of adding Umbraco.
I put it in this order because that's what the docs for Cloud say.
I do have the Serilog sink already setup. I'll get back to you after collecting some more telemetry.
Unfortunately, an exception was still logged in Umbraco but not tracked in AI:
System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Convert.ToDecimal(String value, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at SixLabors.ImageSharp.Web.Commands.Converters.IntegralNumberConverter`1.ConvertFrom(CommandParser parser, CultureInfo culture, String value, Type propertyType)
at SixLabors.ImageSharp.Web.Processors.QualityWebProcessor.Process(FormattedImage image, ILogger logger, CommandCollection commands, CommandParser parser, CultureInfo culture)
at SixLabors.ImageSharp.Web.Processors.WebProcessingExtensions.Process(FormattedImage source, ILogger logger, IReadOnlyList`1 processors, CommandCollection commands, CommandParser parser, CultureInfo culture)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext httpContext, IImageResolver sourceImageResolver, ImageContext imageContext, CommandCollection commands, Boolean retry)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.ProcessRequestAsync(HttpContext httpContext, IImageResolver sourceImageResolver, ImageContext imageContext, CommandCollection commands, Boolean retry)
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 121
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Exceptions not recorded in Azure Application Insights
I added Azure Application Insights (AI) to my Umbraco 10 website:
I can see exceptions being logged in Umbraco using the Log Viewer, but those exceptions are not being recorded in AI.
Any idea what I should do to get them into AI?
Hi Niels,
I have added
services.AddApplicationInsightsTelemetry();
beforeservices.AddUmbraco(_env, _config)
I also set the Serilog sink via the appsettings.json
Hope this helps,
Matt
I'll try putting
services.AddApplicationInsightsTelemetry();
in front of adding Umbraco. I put it in this order because that's what the docs for Cloud say.I do have the Serilog sink already setup. I'll get back to you after collecting some more telemetry.
Unfortunately, an exception was still logged in Umbraco but not tracked in AI:
In addition to the configuration Matthew has posted you will need to install the Serilog Sink package - https://github.com/serilog-contrib/serilog-sinks-applicationinsights
And ensure you have the environment variable
APPLICATIONINSIGHTS_CONNECTION_STRING
- https://github.com/serilog-contrib/serilog-sinks-applicationinsights#configuring-with-readfromconfigurationI have this configured already, thank you!
is working on a reply...