|
5 | 5 | - Add support for distributed tracing in `sentry-delayed_job` [#2233](https://github.com/getsentry/sentry-ruby/pull/2233)
|
6 | 6 | - Fix warning about default gems on Ruby 3.3.0 ([#2225](https://github.com/getsentry/sentry-ruby/pull/2225))
|
7 | 7 | - 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 | + ``` |
8 | 39 |
|
9 | 40 | ### Bug Fixes
|
10 | 41 |
|
|
0 commit comments