Support `Transaction#set_measurement`
This PR adds the concept of custom measurement to Transaction and a new Transaction#set_measurement API. It should be the Ruby equivalent of https://github.com/getsentry/sentry-python/pull/1359.
Changes
- Add
Sentry::Configuration#experimentsfor containing experimental features' configs. - Add
cofnig.experiments.custom_measurementsfor toggling custom measurement's activation (default: inactive). - Add
Transaction#measurementsandTransaction#set_measurement(name, value, unit = "").
Codecov Report
Base: 98.63% // Head: 98.62% // Decreases project coverage by -0.01% :warning:
Coverage data is based on head (
7b5e21b) compared to base (193446b). Patch coverage: 100.00% of modified lines in pull request are covered.
:exclamation: Current head 7b5e21b differs from pull request most recent head bbce93f. Consider uploading reports for the commit bbce93f to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #1838 +/- ##
==========================================
- Coverage 98.63% 98.62% -0.01%
==========================================
Files 157 157
Lines 10009 10059 +50
==========================================
+ Hits 9872 9921 +49
- Misses 137 138 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| sentry-ruby/lib/sentry/configuration.rb | 98.51% <100.00%> (+<0.01%) |
:arrow_up: |
| sentry-ruby/lib/sentry/event.rb | 98.78% <100.00%> (+0.01%) |
:arrow_up: |
| sentry-ruby/lib/sentry/transaction.rb | 100.00% <100.00%> (ø) |
|
| sentry-ruby/lib/sentry/transaction_event.rb | 100.00% <100.00%> (ø) |
|
| sentry-ruby/spec/sentry/configuration_spec.rb | 100.00% <100.00%> (ø) |
|
| sentry-ruby/spec/sentry/transaction_spec.rb | 100.00% <100.00%> (ø) |
|
| sentry-ruby/lib/sentry/breadcrumb.rb | 96.29% <0.00%> (-3.71%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@st0012 The UI is still WIP. So far only JS and python SDKs have this API, and ingest is partially ready. UI work will follow in the coming month.
@sl0thentr0py I feel it'll be more useful to have something like
transaction.measure("metrics.foo", "millisecond") do
# operation
end
# and also
Sentry.measure_with_transaction("metrics.foo", "millisecond", transaction: optional_transaction) do
# operation
end
And then the measurement can be set without manually retrieving the transaction.
ping @sl0thentr0py
@st0012 I'll take a look at this tomorrow, but just wanted to say we shouldn't actually ship this till measurements are ready end-end in the product. We added the python/JS stuff to get started internally for development.
Ah I see. In that case, no need to rush it then 👍
This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
@st0012 will review this shortly, but if we wanna include this now, I think we don't need this to be experimental anymore.
Re: the top-level API helpers like Sentry.measure_with_transaction, we have to decide internally on naming/behavior but we can ship those separately afterwards.
If the name is still not settled, I'm fine with merging it later. I was justing seeing if things can be shipped together, not that I wanted to push this 🙂
alright, yea let's leave this for the next minor then, the UI is still WIP so it's fine to push this a bit later.
ok UI landed now https://github.com/getsentry/sentry/pull/39543
any updates on this? Our team would appreciate this functionality a lot
@sl0thentr0py So once I rebased this PR, it'll be ok to merge it?
yes I was planning to merge this this week, go ahead!