Try to make MEL and Serilog integrations behave more consistently

Open
#5,635 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
observability

Research direction

Start by comparing SentryOptions.cs, SerilogScopeEventProcessor.cs, and SentryScopeManager.cs, focusing on the four differences listed in the issue. Review the linked MEL and Serilog entry points and determine the desired consistent behavior before making changes. Done means the integrations agree on value handling, read timing, opt-out support, and global-mode behavior.

Written by the indexing model from the issue text.

Description

Logs State: Needs Discussion
  • Which values: MEL keeps only string values (UserId = 42 is dropped). Serilog converts every property with ToString().
  • When they're read: MEL copies the values into the Sentry scope when BeginScope is called. Serilog reads LogContext each time an event is captured.
  • Opt-out: MEL can be customised or switched off through the public SentryOptions.SentryScopeStateProcessor. The Serilog processor is internal, so it can't be removed or replaced.
  • Global mode (MAUI, desktop): MEL's PushScope does nothing there. The Serilog processor still runs.

Originally posted by @ric-oliv in https://github.com/getsentry/sentry-dotnet/issues/5573#issuecomment-5874074940

Dominant language
C#
Stars
775
Forks
262
Avg merge
1d 16h
Merged PRs (30d)
118

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.