Support status code ranges when configuring TraceIgnoreStatusCodes from appsettings.json

オープン
#5,644 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp

調査の方向性

Start by locating BindableSentryOptions.TraceIgnoreStatusCodes and its ApplyTo method, then inspect how configuration binding and status-code defaults are tested. Support numeric strings and inclusive ranges while preserving existing numeric configurations; verify that configured ranges and individual codes produce the expected ignored statuses, and clarify whether FailedRequestStatusCodes is included.

索引モデルが issue の本文から書いたものです。

説明

.NET Improvement State: Needs Discussion Traces

TraceIgnoreStatusCodes can be set from configuration, but only as a list of individual status codes: BindableSentryOptions.TraceIgnoreStatusCodes is a List<int>. Configuration can't express a range, and "TraceIgnoreStatusCodes": [ "305-399" ] throws an InvalidOperationException at startup.

This matters more in 7.0, where the default becomes [301, (305, 399), (401, 404)] (#5632). Configuration replaces the default rather than adding to it, so keeping the default and ignoring one more code from appsettings.json means listing around 100 integers.

Proposal

Change the bindable property to a List<string> and parse each entry in ApplyTo as either a single code ("404") or an inclusive range ("305-399"). JSON numbers bind to string without problems, so existing configs like [ 404, 429 ] keep working.

"Sentry": {
  "TraceIgnoreStatusCodes": [ 301, "305-399", "401-404", 429 ]
}

FailedRequestStatusCodes has no bindable equivalent at all today, so it could get the same treatment.

Raised by @ric-oliv in https://github.com/getsentry/sentry-dotnet/pull/5632#issuecomment-5892916655

主要言語
C#
スター
775
フォーク
262
平均マージ
1日 16時間
マージ済み PR(30日)
118

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-dotnet のほかの issue

getsentry/sentry-dotnet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。