Skip to content

docs(samples): add READMEs for the ASP.NET Core MVC and Serilog samples - #6057

Merged
jamescrosswell merged 4 commits into
mainfrom
ai/triagent-772
Dec 3, 2026
Merged

jamescrosswell merged 4 commits into
mainfrom
ai/triagent-772

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Summary

Two of the most visited samples in the repo had little or no README. This adds one to each, modelled on the Log4Net sample's:

  • Sentry.Samples.AspNetCore.Mvc: replaces the short blocking-detection note with an overview of what the sample shows (errors, logging, tracing, blocking detection, event processors, user feedback, tunneling), how to run it, and a table of each page/route and what it sends to Sentry.
  • Sentry.Samples.AspNetCore.Serilog: new README covering the early SentrySdk.Init, the Serilog sink levels, how to run it, and its /greetings and /throw routes.

Both explain the two ways to supply a DSN that the samples actually support (SENTRY_DSN at build time, or SamplesShared.cs). The old MVC README pointed at Sentry:Dsn in appsettings.json, which the sample overrides in code.

Notes for review:

  • No screenshots/GIFs (the Log4Net README has one); those need a real Sentry project to capture.
  • The Serilog sample logs an error on every request, so every request produces an event. The README says so rather than changing the sample.

#skip-changelog

Closes #772

🤖 Generated with Claude Code

Closes #772

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: low

For commit c2909b4.

This label is a hint for reviewers, not an approval.

@sentry-junior sentry-junior Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to approve and merge

Adds READMEs for the two samples named in #772 (MVC rewritten, Serilog new), which closes the issue. The latest commit drops TracesSampleRate from the Serilog sample's appsettings.json, which matches the code: the sample never adds routing, so no transactions are sent, and the README no longer claims any. Routes, ports, options, DSN instructions and the described Sentry output match each sample's code at this head.

This is an automated preliminary review.

- Mention the 'Param is null!' warning event the Home form and AJAX post also send.
- DiagnosticLevel is Error, so Debug only prints the SDK's errors.
- Align the appsettings.json DSN comment with the Serilog sample's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.52%. Comparing base (99c7489) to head (c2909b4).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6057      +/-   ##
==========================================
+ Coverage   78.32%   78.52%   +0.20%     
==========================================
  Files         537      539       +2     
  Lines       20134    20194      +60     
  Branches     4055     4062       +7     
==========================================
+ Hits        15769    15857      +88     
+ Misses       3517     3491      -26     
+ Partials      848      846       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review December 1, 2026 00:21
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 1, 2026
- Serilog sample sends no transactions: it never calls UseRouting.
- Capture page doesn't show the event ID.
- DSN comments in appsettings.json point at SENTRY_DSN or SamplesShared.cs.
- Suggest DiagnosticLevel Info, since Debug is filtered by ILogger after startup.
- Mention the HTTPS-redirect warning, Serilog structured logs, and that
  static files and 404s don't send transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 2, 2026

@ric-oliv ric-oliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

Comment on lines 6 to 7
// Enable Sentry tracing features
"TracesSampleRate": 1.0,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the README doesn't mention tracing, this is the one place left that suggests the sample sends transactions, and it doesn't (no UseRouting, so no tracing middleware). Drop it?

Suggested change
// Enable Sentry tracing features
"TracesSampleRate": 1.0,

The sample never adds routing, so the tracing middleware never runs and no transactions are sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 3, 2026
@jamescrosswell
jamescrosswell merged commit f28093d into main Dec 3, 2026
42 checks passed
@jamescrosswell
jamescrosswell deleted the ai/triagent-772 branch December 3, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a nice README to some samples

2 participants