Skip to content

Tag error_class on timed_operation failures - #81

Open
converliz wants to merge 1 commit into
mainfrom
add-error-class-tag-3074
Open

converliz wants to merge 1 commit into
mainfrom
add-error-class-tag-3074

Conversation

@converliz

Copy link
Copy Markdown

Adds an error_class tag to the timed_operation Datadog metric so we can actually see what failed, not just that something did. Right now failures just show up as status:error with no further detail.

Only tagging the exception class name (never the message) so we don't accidentally leak usernames or other identifying info into Datadog tags.

Part of github/sae-iam-team#3074

Corrected the indentation of the rescue block for better readability and consistency.
Copilot AI balanced review requested due to automatic review settings September 18, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The existing failed-operation unit test will fail until its expected tags include error_class:RuntimeError.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds exception class names to failed timed_operation Datadog metrics without exposing exception messages.

Changes:

  • Appends an error_class tag when an operation raises.
  • Re-raises the original exception.
File Description
lib/​entitlements.rb Tags failed timed operations with their exception class.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/entitlements.rb
tags[1] = "status:success"
result
rescue => e
tags << "error_class:#{e.class.name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants