Open Bug 1886810 Opened 1 year ago Updated 1 year ago

Consider a lint forbidding non-ping-lifetime _distribution metrics

Categories

(Data Platform and Tools :: Glean: SDK, task, P4)

task

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: chutten, Assigned: chutten)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

_distribution metrics are collections of samples. Sending the same samples in multiple pings or losing samples because there was no ping sent in that application session seem like mistakes, not use cases.

We could forbid this from happening, but maybe there are use cases for these somehow. So maybe we should just lint them, and write some commentary in the metric type docs to explain why.

My feeling is we should allow user lifetimes in addition to ping, but gated via a warn.

While we typically work with distributions in the add them together style, user lifetime represents "current state" and while I think there is some danger in folks getting confused, that strikes me as a perfectly valid way to look at data. It may be unnecessary and slightly lossy though, so a warn is justified.

I agree that Application lifetime should be completely disallowed. It's almost certainly going to induce double counting to some degree, for no benefit. Let's consider a concrete case where the application is open starting at say, 11PM on a Monday, and remains so until Wednesday morning at 8AM. This spans two metrics ping sends. The first Metrics ping has data from 11PM to 4AM the following day. The second Metrics ping has that data, too, plus itself, such that if you add the two together, you double count data from the first day. Backing this is out would be sufficiently complex as to be practically impossible.

We should encourage folks who have a demonstrated need to have a different schedule for distribution collections than the Metrics ping to use a ping lifetime on a custom ping.

Assignee: nobody → chutten
Status: NEW → ASSIGNED
Priority: -- → P2
Blocks: 1891842
Priority: P2 → P4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: