"Invalid Character" when using Scope names with state
See original GitHub issuePlease mark the type framework used:
- ASP.NET MVC
- ASP.NET Web API (OWIN)
- ASP.NET Core
- WPF
- WinForms
- Xamarin
- Other:
Please mark the type of the runtime used:
- .NET Framework
- Mono
- .NET Core
- Version:
Please mark the NuGet packages used:
- Sentry
- Sentry.Serilog
- Sentry.NLog
- Sentry.Log4Net
- Sentry.Extensions.Logging
- Sentry.AspNetCore
- Version: 2.1.8
When using the AspNetCore ILogger like this:
using (logger.BeginScope("HTTP {HttpMethod} {Uri}", "123", "1234")){
logger.LogCritical("Test");
}
This creates a scope called “HTTP 123 1234” and additional tags “HttpMethod: 123” and “Uri: 1234”. Sentry successfully gets the tags but the scope results in an error in the sentry frontend like this:
The tags json will contain:
{"value":"HTTP {HttpMethod} {Uri}","key":null}
I think Sentry should be able to use “HTTP 123 1234” as value and probably have “scope” as a tag key (Are arrays supported as tag keys?)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Tomcat: java.lang.IllegalArgumentException: Invalid ...
This exception can occur when you try to execute HTTPS request from client on endpoint which isn't HTTPS enabled.
Read more >Character causes invalid character error · Issue #147
I ran into this issue with a production app; we discovered our users were entering emoji characters into description fields and we would...
Read more >Invalid keyscope name reported · Issue #2228 · dita-ot ...
Invalid key scope name "chrysanthèmes". Looking in the specs, ... I'm surprised that we don't explicitly state what characters are allowed.
Read more >Character name invalid characters : r/pathofexile
Character name invalid characters. I know they changed something a couple leagues ago with the allowed characters but I still see names on ......
Read more >The variables contains invalid characters. - TechDocs
The field accepts the following national language characters only: @ # $. Field name. Table name of a record object. The first character...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That actually already works. With the example above I get “HttpMethod” as Key and “123” as value but the message itself is passed without any kind of replacement and any kind of key which marks it as invalid in the frontend. I guess the tags work cause FormattedLogValues is based on a IReadOnlyList<KeyValuePair<string, object>>
I can take a look if I can get a PR ready 😄
I am experiencing this exact problem too. We have recently updated our asp .net core version to 3.1 and sentry to 2.1.8