Skip to content

Shared metrics attributes are garbled #2880

@geigerzaehler

Description

@geigerzaehler

Issue Description

When a shared attributes hash is passed to Sentry.metrics.count or other metrics methods the attributes become garbled. (This is caused by a mutation of the attributes hash here)

Reproduction Steps

Use the following code somewhere

attributes = {bar: "qux"}
Sentry.metrics.count("foo", value: 1, attributes:)
Sentry.metrics.count("foo", value: 1, attributes:)

Expected Behavior

In the UI when I look at the metrics event "foo" it has the attributes bar: "qux".

Actual Behavior

I see that the value for the attribute bar is {"value":"qux","type":"string"}

Image

Ruby Version

3.1.7

SDK Version

6.4.1

Integration and Its Version

No response

Sentry Config

Sentry.init do |config|
  config.dsn = ENV.fetch("SENTRY_DSN", nil)
end

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions