Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Let apps shape the fingerprint, so a message with a per-request id doesn't split one error into many

未關閉
#116 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@namolnad 已經在處理了。

開始於 2026年10月19日。

  • #121 來自 @namolnad —— 未關閉

評估

難度
4/5
預估耗時
1-2 天
新手友好度
54/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rails, ruby

研究方向

Start by reading Subscriber#report and the fingerprint configuration path; the issue names these as the likely change points but does not give file paths or tests. Compare the proposed configurable fingerprint hook with the narrower message-normalizing option, then check the README and existing subscriber tests. Done means the chosen option groups messages with changing request IDs while retaining the reported message, with configuration documented and tests covering the behavior.

由索引模型根據 Issue 內容生成。

描述

An error's fingerprint is a hash of its class, message, severity and source. When a message embeds something that changes with every occurrence, such as a request id, a record id or a timestamp, each occurrence becomes an error of its own. The dashboard fills with near-identical errors that each have one occurrence. That hides a real outage, which looks like hundreds of new errors rather than one error with hundreds of occurrences, and since every one is "new", each one is emailed.

The case we hit is API client errors that end with the provider's request id:

Anthropic::Errors::InternalServerError: Internal server error (request_id: req_011CT8...)

What we do today is wrap the subscriber. We unsubscribe SolidErrors::Subscriber and subscribe one that rewrites the exception's message, replacing req_... with a placeholder and moving the id into the context, before handing it on. It works, but it means replacing the gem's subscriber and redefining #message on the exception.

A possible shape: an optional hook that turns the attributes into the fingerprint, defaulting to what happens now:

config.solid_errors.fingerprint = ->(error:, attributes:) {
  message = attributes[:message].gsub(/\breq_[A-Za-z0-9]+/, "req_*")
  [attributes[:exception_class], message, attributes[:severity], attributes[:source]].join
}

The stored message would stay as reported, so the id is still there to quote, and only the grouping would change. A narrower alternative is a message-normalizing proc that applies only to the fingerprint.

Would something like this be welcome? If so, I can send a small PR: the config option, the call in Subscriber#report, a README section and tests.

主要語言
Ruby
星號
498
分支
36
平均合併
12 小時 38 分鐘
30 天內合併 PR
20

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。