dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

[FEATURE]: Add a custom tag to errors

Open liaden opened this issue 8 months ago • 2 comments

Gem Name

No response

Gem Version(s)

No response

Describe the goal of the feature

Generically, I want to be able to add additional tags to allow for searching on errors.

Is your feature request related to a problem?

We have a monolith application with multiple teams supporting. Using the code_ownership, I want to add a team label where the value is CodeOwnership.for_backtrace(e).

Describe alternatives you've considered

  1. Using Rails.error.handle to: a. Create a nested span with the appropriate tags to attach the error b. Do Datadog::Tracing.active_span.set_tag('error.team', team)
  2. Using the on_error for some integrations (such as Sidekiq) to do the above, but there isn't one for Rails controllers (or Rack requests).
  3. Monkeypatching Datadog::Tracing::Metadata::Errors#set_error_tags to attach the extra tags.

Additional context

No response

How does Datadog help you?

No response

liaden avatar Apr 30 '25 14:04 liaden