-
-
Notifications
You must be signed in to change notification settings - Fork 224
feat(measurements): Add new measurements section to transaction #515
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sentry/develop/8uGACV9ZwrynqT9fe7eLUyHFxPL4 |
|
||
: _Optional_. An object containing standard/custom measurements with keys signifying the name of the measurement. | ||
|
||
Standard measurement keys currently supported are from the set `"fp" | "lcp" | "fid" | "ttfb" | "ttfb.requesttime"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took these from here and also from the various setters in sentry-javascript/metrics
. Feel free to add/update this list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interesting that the mobile vitals are not in the Sentry allow list. So you can't do discover arithmetic on them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is another list here which also has cls
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm perhaps @wmak can help figure this out here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not being able to do arithmetic on vitals is definitely an oversight on my part (ie. we didn't update this allowlist when working on it)
But i believe the standard measurement list should be everything we prefix measurements on in the UI? ie. we should include the ones here that aren't rates or percentages (those are computed)
|
||
Standard measurement keys currently supported are from the set `"fp" | "lcp" | "fid" | "ttfb" | "ttfb.requesttime"`. | ||
|
||
Custom measurements need units to be specified. Units currently supported are durations from the set `"ns" | "ms" | "s"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and these I took from relay/MetricUnit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check which units would actually make sense and how we would like to specify units? What we have in Relay was only a stub, and now is a good time to rethink this. Generally, we have two options:
- Define a strict allow list of units that we define in Relay, and then propagate down.
- Allow arbitrary strings as unit. Relay still lists well-known units that it can handle, eg. for conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so making a list of potentially useful categories, maybe product people have to add here.
type | units | remarks |
---|---|---|
time | ns, microseconds, ms, s, m | longer than minute not useful, formatting for microseconds |
memory | bytes, KiB, MiB, GiB, TiB | KB vs KiB |
unitless / absolute counts | ||
unitless / percentages | % |
Formatting consistently for some cases is problematic if we go with short forms, for instance microseconds
vs ns
and I don't know if we want to get into unicode mess here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of the value provided by arbitrary user strings.
There's no semantic associated with a random foobar
unit, so I assume it will just be a passthrough all the way to wherever the metric will be displayed on the UI. I think it is more valuable to actually look at valid measurement use cases and we can always extend our supported list with things that make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok looking around a bit, should have done this first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pinging Kevan to also take a look here.
|
||
: _Optional_. An object containing standard/custom measurements with keys signifying the name of the measurement. | ||
|
||
Standard measurement keys currently supported are from the set `"fp" | "lcp" | "fid" | "ttfb" | "ttfb.requesttime"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clarify what "supported" means here?
Also, what do you think about linking to the relay/sentry allow list code here?
This is all browser web vitals, we also need to include the mobile vitals here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 'supported' is open to discussion based on either
- what is currently implemented end-end in browser/mobile
- what gets assigned units automatically if we say we need units for custom measurements from the user (?)
"frames_slow_rate", | ||
"frames_frozen_rate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we don't use them, @philipphofmann what's about on iOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't use frames_slow_rate
and frames_frozen_rate
, but we use the others above.
"stall_count", | ||
"stall_total_time", | ||
"stall_longest_time", | ||
"stall_percentage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find the usage of this one on RN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's referenced by Sentry: https://github.com/getsentry/sentry/blob/7447331d8e02031d585bd0c0aec76ed1334b9bde/src/sentry/search/events/constants.py#L32
Couldn't find it in Relay, not sure how this works. Maybe @untitaker can help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the open questions here is if relay will 'know' the difference between standard/custom measurements or if this will only be reflected in the sentry codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding stall_*
measurements: I searched through all of getsentry, and it looks like they were only defined in Sentry. Later on, we pulled them into Relay and the ingest load tester. If they are not emitted by any SDK, we should remove them.
Regarding units: Relay will have to know about units of the past built-in measurements for backwards compatibility. For new measurements, and also going forward for all SDKs, it would be better to declare all units on the client and send them in to avoid mismatches and outdated lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I understood @jan-auer correctly, relay will have to know existing/standard measurements to infer their units.
currently only sentry has such a list, whether that list moves to Relay is tbd (we currently send it from sentry to relay via projectconfig)
EDIT: jinx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, and the rates / percentages are defined in Sentry so they don't have to be added to the public interface:
https://github.com/getsentry/sentry/blob/1c4ee6be215dadbf9bec19b3b428464a1dfe05b3/src/sentry/search/events/fields.py#L380-L418
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm wondering whether we should mark them as reserved and then never use them. They'll be defined as derived metrics in Sentry and can never be ingested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not do any special casing for the three computed "measurements", but document them as reserved. That means, we should not reject the names in SDKs or during ingestion, but we should let people know that the name is used in Sentry.
There can be multiple metrics with the same name, and they are disambiguated in the API by type, so in the product we'll be fine. I'm still working out what that would mean for Discover though.
@wmak sharing a thought here that we can follow up on somewhere else: We should evaluate renaming those three specific measurements:
- Two are called
*_rate
like everything else in the product, but one is called_percentage
. As opposed to functions likefailure_rate()
they can be computed within a single transaction though, if I'm not mistaken? So the question is do they behave like measurements (i.e. distributions), then we should materialize them, if they are aggregate percentages, they should rather become functions. - They share the same namespace with ingested measurements but they are not actually ingested. I wonder if they should actually be materialized in Relay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can be computed within a single transaction 👍
Is it possible to materialize these in relay if they're going to be a metric as well? Would simplify the product a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in that case we can do the division in Relay, write them back into the measurements array, before extracting metrics for all measurements including the computed ones. I'd have to think a bit about migrating this forward, for a while we should probably keep the computation in discover around until we've reached 90d of history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we including measurements that are not sent by the client but are generated on the backend?
"stall_count", | ||
"stall_total_time", | ||
"stall_longest_time", | ||
"stall_percentage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's referenced by Sentry: https://github.com/getsentry/sentry/blob/7447331d8e02031d585bd0c0aec76ed1334b9bde/src/sentry/search/events/constants.py#L32
Couldn't find it in Relay, not sure how this works. Maybe @untitaker can help.
Summarizing the discussion so far.
|
No description provided.