-
-
Notifications
You must be signed in to change notification settings - Fork 220
feat: add Sentry Logs (experimental) #4308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… `Sentry.AspNetCore` and `Sentry.Maui` (#4193) * feat(logs): initial experiment * feat(logs): basic Logger Module API shape * style(logs): consolidate * ref(logs): remove generic WriteSerializable overload * ref(logs): consolidate experimental Diagnostic-ID * feat(logs): add experimental options * ref(logs): remove custom polyfills now provided through Polyfill * Format code * ref(logs): move types out of Experimental namespace * feat(logs): change 'integer' from Int32 to Int64 * ref(logs): refine API surface area * ref(logs): match SeverityLevel to OTel spec * ref(logs): rename SentrySeverity to LogSeverityLevel * Format code * ref(logs): hide underlying Dictionary`2 for Attributes * ref(logs): restructure attributes * ref(logs): extract TraceId and ParentSpanId methods * ref(logs): remove `SentryOptions.LogsSampleRate` * feat(logs): support ISystemClock abstraction * ref(logs): disambiguate SentryLogger names * ref(logs): consolidate names of Log-Methods * ref(logs): rename LogSeverityLevel to SentryLogLevel * ref(logs): re-rename new logger type * ref(logs): move Logger instances to Hubs * test(logs): add tests * Format code * fix(logs): incorrectly serializing attributes * fix(logs): do not capture log when template/parameters are invalid * fix(logs): do not capture log on user callback exceptions * ref(logs): move new public types to root namespace * ref(logs): rework sample * ref(logs): ensure that DisabledHub dues not capture logs * ref(logs): allow out-of-range Log-Level * docs(logs): add XML comments indicating that logs will be ignored on delegate exceptions * docs(logs): add to changelog * fix(logs): add to Bindable-Options * fix(logs): add to ApiApprovalTests * test(logs): add missing net48 ApiApproval * test(logs): fix line endings on Windows * Update src/Sentry/Protocol/Envelopes/Envelope.cs Co-authored-by: Bruno Garcia <[email protected]> * Update SentryLog.cs Co-Authored-By: Bruno Garcia <[email protected]> * test(logs): fix floating-point ToString expectation for .NET Framework * ref(logs): remove some using declarations * test(ci): trying to work around floating-point formatter on .NET Framework * test(logs): skip failing tests on Mono (non-Windows) * test(log): fix Skip.If missing SkippableFact * try: fix floating-point formatting on Windows * feat(logs): Sentry.Extensions.Logging * feat(logs): Sentry.AspNetCore * feat(logs): Sentry.Maui * fix(logs): Logging Filter * Format code * feat(logs): add CHANGELOG entry * release: 5.8.0-alpha.0 * ref: make SentryStructuredLogger abstract * docs: add comment to sample usage of SetBeforeSendLog Co-authored-by: Bruno Garcia <[email protected]> * ref: clarify intent of usages of Debug.Assert * docs: improve XML comments * test: range of Severity-Number specification * test: GetValuesAsUnderlyingType of the new enum * ref: move Log options to Experimental section * ref: move Logger to Experimental section of SDK * test: add Hub tests * test: update verified public API * docs: update CHANGELOG.md * ref: move Log-rerelated Options to Experimental sub-section * ref: reuse Disabled-Instance when Structured-Logging is not enabled * ref: remove Enabled-checks on Default-Logger * ref: rename DisabledSentryStructuredLogger to NoOpSentryStructuredLogger * ref: make `BindableSentryOptions.Experimental` internal Co-authored-by: James Crosswell <[email protected]> * Revert "ref: make `BindableSentryOptions.Experimental` internal" This reverts commit 45b8687. * docs: Update CHANGELOG.md Co-authored-by: Bruno Garcia <[email protected]> * Revert "ref: rename DisabledSentryStructuredLogger to NoOpSentryStructuredLogger" This reverts commit c0a1cd5. * ref: replace use of ScopeManager with TraceHeader * test: remove Skip as we no longer test net48 against non-Windows * feat: support more numeric types * feat: support char attributes * fix: build error targeting .NET Standard 2.0 and .NET Framework * fix: exception when passing null as message parameter * test: add Attributes-To-Json test * fix: missing type on .NET Framework * feat: support Attribute-Types from spec * ref: clarify internal identifiers * test: update approved API * test: fix incorrect expectation * feat: use "wrapping" SDK's Name and Version * fix: Get-Attribute-API * docs: update CHANGELOG * docs: update CHANGELOG * test: change options to Experimental section * docs: merge CHANGELOG * ref/fix: M.E.L integrations * fix: M.E.L. formatter may throw when CA2017 is violated * fix: Logger uses .NET MAUI SDK name * fix: send log timestamp with milliseconds * perf: avoid redundant array copy * Update CHANGELOG.md * ref(docs): remove ExperimentalAttribute on internal types and members * style(logs): use Recursive Pattern Matching Co-authored-by: James Crosswell <[email protected]> * test(logs): add coverage for missing message --------- Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: Bruno Garcia <[email protected]> Co-authored-by: Bruno Garcia <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: getsentry-bot <[email protected]> Co-authored-by: James Crosswell <[email protected]>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're 95% there (once it's passing CI).
@Flash0ver and I discussed merging this logger with our other logger, so that we can elegantly handle things like ILogger.BeginScope
but this is already pretty solid for an experimental feature so let's get it out there and get some feedback while we work on those other things.
Nice work Stefan! ❤️ 🚀
Add support, API and integrations for Sentry Logs
Integration branch / PR of
Sentry.Extensions.Logging
and integrations forSentry.AspNetCore
andSentry.Maui
#4193