Skip to content

Commit eaedf33

Browse files
committed
changelog
1 parent bdac066 commit eaedf33

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CHANGELOG.md

+31
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@
55
- Add support for distributed tracing in `sentry-delayed_job` [#2233](https://github.com/getsentry/sentry-ruby/pull/2233)
66
- Fix warning about default gems on Ruby 3.3.0 ([#2225](https://github.com/getsentry/sentry-ruby/pull/2225))
77
- Add `hint:` support to `Sentry::Rails::ErrorSubscriber` [#2235](https://github.com/getsentry/sentry-ruby/pull/2235)
8+
- Add [Metrics](https://docs.sentry.io/product/metrics/) support
9+
- Add main APIs and `Aggregator` thread [#2247](https://github.com/getsentry/sentry-ruby/pull/2247)
10+
The SDK now supports recording and aggregating metrics. A new thread will be started
11+
for aggregation and will flush the pending data to Sentry every 5 seconds.
12+
13+
To enable this behavior, use:
14+
15+
```ruby
16+
Sentry.init do |config|
17+
# ...
18+
config.enable_metrics = true
19+
end
20+
```
21+
22+
And then in your application code, collect metrics as follows:
23+
24+
```ruby
25+
# increment a simple counter
26+
Sentry::Metrics.incr('button_click')
27+
# set a value, unit and tags
28+
Sentry::Metrics.incr('time', 5, 'second', tags: { browser:' firefox' })
29+
30+
# distribution - get statistical aggregates from an array of observations
31+
Sentry::Metrics.distribution('page_load', 15.0, 'millisecond')
32+
33+
# gauge - record statistical aggregates directly on the SDK, more space efficient
34+
Sentry::Metrics.gauge('page_load', 15.0, 'millisecond')
35+
36+
# set - get unique counts of elements
37+
Sentry::Metrics.set('user_view', 'jane')
38+
```
839

940
### Bug Fixes
1041

0 commit comments

Comments
 (0)