Conversation
Corrected the indentation of the rescue block for better readability and consistency.
There was a problem hiding this comment.
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
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_classtag 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.
| tags[1] = "status:success" | ||
| result | ||
| rescue => e | ||
| tags << "error_class:#{e.class.name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds an
error_classtag to thetimed_operationDatadog metric so we can actually see what failed, not just that something did. Right now failures just show up asstatus:errorwith 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