The SDK now supports recording and aggregating metrics. A new thread will be started
for aggregation and will flush the pending data to Sentry every 5 seconds.
And then in your application code, collect metrics as follows:
# increment a simple counterSentry::Metrics.increment('button_click')# set a value, unit and tagsSentry::Metrics.increment('time',5,unit: 'second',tags: {browser:' firefox'})# distribution - get statistical aggregates from an array of observationsSentry::Metrics.distribution('page_load',15.0,unit: 'millisecond')# gauge - record statistical aggregates directly on the SDK, more space efficientSentry::Metrics.gauge('page_load',15.0,unit: 'millisecond')# set - get unique counts of elementsSentry::Metrics.set('user_view','jane')# timing - measure duration of code block, defaults to seconds# will also automatically create a `metric.timing` spanSentry::Metrics.timing('how_long'){sleep(1)}# timing - measure duration of code block in other duraton unitsSentry::Metrics.timing('how_long_ms',unit: 'millisecond'){sleep(0.5)}
You can filter some keys or update tags on the fly with the before_emit callback, which will be triggered before a metric is aggregated.
Sentry.initdo |config|
# ...# the 'foo' metric will be filtered and the tags will be updated to add :bar and remove :bazconfig.metrics.before_emit=lambdado |key,tags|
returnnilifkey == 'foo'tags[:bar]=42tags.delete(:baz)trueendend
By default, the SDK will send code locations for unique metrics (defined by type, key and unit) once a day and with every startup/shutdown of your application.
You can turn this off with the following:
The SDK now supports recording and aggregating metrics. A new thread will be started
for aggregation and will flush the pending data to Sentry every 5 seconds.
And then in your application code, collect metrics as follows:
# increment a simple counterSentry::Metrics.increment('button_click')# set a value, unit and tagsSentry::Metrics.increment('time',5,unit: 'second',tags: {browser:' firefox'})# distribution - get statistical aggregates from an array of observationsSentry::Metrics.distribution('page_load',15.0,unit: 'millisecond')# gauge - record statistical aggregates directly on the SDK, more space efficientSentry::Metrics.gauge('page_load',15.0,unit: 'millisecond')# set - get unique counts of elementsSentry::Metrics.set('user_view','jane')# timing - measure duration of code block, defaults to seconds# will also automatically create a `metric.timing` spanSentry::Metrics.timing('how_long'){sleep(1)}# timing - measure duration of code block in other duraton unitsSentry::Metrics.timing('how_long_ms',unit: 'millisecond'){sleep(0.5)}
You can filter some keys or update tags on the fly with the before_emit callback, which will be triggered before a metric is aggregated.
Sentry.initdo |config|
# ...# the 'foo' metric will be filtered and the tags will be updated to add :bar and remove :bazconfig.metrics.before_emit=lambdado |key,tags|
returnnilifkey == 'foo'tags[:bar]=42tags.delete(:baz)trueendend
By default, the SDK will send code locations for unique metrics (defined by type, key and unit) once a day and with every startup/shutdown of your application.
You can turn this off with the following:
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu cancel merge
Cancels automatic merging of this PR
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ sentry-rails (5.16.1 → 5.17.1) · Repo · Changelog
Release Notes
5.17.1
5.17.0
Does any of this look wrong? Please let us know.
↗️ sentry-ruby (indirect, 5.16.1 → 5.17.1) · Repo · Changelog
Release Notes
5.17.1
5.17.0
Does any of this look wrong? Please let us know.
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands