Skip to content

Sentry.metrics.count doesn't emit user attributes #2842

@KazWolfe

Description

@KazWolfe

Issue Description

Per the Metrics documentation, user information is supposed to be added to any metrics published. At present with version 6.3.0, however, this does not appear to be the case.

Reproduction Steps

  1. Call Sentry.set_user in the base ApplicationController.
  2. Attempt to log metrics from a controller that inherits this.

Specific code that triggers this bug:

Sentry.metrics.count(
  "my.metric.here",
  value: 1,
  attributes: {
    "some.metric.path": "some_value"
  }

A logger.warn("SENTRY USER INFO:", Sentry.get_current_scope.user) statement immediately prior does print user information, so it's definitely there within the scope.

Expected Behavior

The final metrics attributes contains user.id and user.email.

Actual Behavior

Only the metrics passed in via attributes make it to the final metrics uploaded to the Sentry dashboard.

Ruby Version

4.0.1

SDK Version

6.3.0

Integration and Its Version

Rails 8.1.2

Sentry Config

https://github.com/KazWolfe/XIVAuth/blob/f7e510ef5e803cf6af6c709a7be77adab6899927/config/initializers/sentry.rb

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions