Skip to content

Rework LiveActivity push stats: broadcasts as apnsLiveActivity, push-to-start as apnsPushToStart - #350

Open
JoaoDiasAbly wants to merge 1 commit into
mainfrom
liveactivity-stats-pushtostart
Open

Rework LiveActivity push stats: broadcasts as apnsLiveActivity, push-to-start as apnsPushToStart#350
JoaoDiasAbly wants to merge 1 commit into
mainfrom
liveactivity-stats-pushtostart

Conversation

@JoaoDiasAbly

@JoaoDiasAbly JoaoDiasAbly commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #349 from the stats discussion on ably/realtime#8527 (approval comments on stats.go): broadcasts are the third APNs notification type and belong under push.notifications.*, per-device push-to-start sends get their own label, and the standalone broadcast counter goes away.

  • push.notifications.*.apnsLiveActivity now documents broadcast issuance: a single request Apple fans out to every subscribed device, the end request's final broadcast included; excluded from the apns/total aggregates, which count per-device sends
  • new push.notifications.*.apnsPushToStart entries for the per-device push-to-start sends (the previous apnsLiveActivity wording)
  • push.apnsBroadcasts removed, superseded by the entries above; request-level accounting already exists via api-request stats

No versions.json bump, following #349. The keys changed here have only been emitted since realtime#8527 (2026-07-17) and the first customer trial hasn't started, so reshaping is still cheap.

Merge before ably/realtime#8560, which switches the emitters and bumps its submodule to pick this up.

- push.notifications.*.apnsLiveActivity now counts broadcast issuance
  (was per-device push-to-start sends), staying out of the apns/total
  aggregates
- add push.notifications.*.apnsPushToStart for the per-device
  push-to-start sends
- drop push.apnsBroadcasts, superseded by the notifications entries
@JoaoDiasAbly
JoaoDiasAbly requested review from Copilot and lmars and removed request for Copilot July 23, 2026 11:34
"type": "number",
"inclusiveMinimum": 0,
"description": "Total number of successfully-delivered APNS Live Activity Push notifications."
"description": "Total number of successfully-issued APNS Live Activity broadcasts, the final broadcast sent by an end request included. Each broadcast is a single request to Apple that Apple fans out to every device subscribed to the broadcast channel (Ably has no per-device visibility), so this counts issuance, not deliveries, and is not included in the apns or total aggregates, which count per-device notifications."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not included in the apns or total aggregates, which count per-device notifications

Why make this distinction?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I think otherwise we'd make the existing total inaccurate:

  • each time we increment the existing total it means "one device got a push"
  • each time we increment this it means "we sent out a broadcast"

Since the fanout for these broadcast is at the Apple's side and as stated in ADR-159 we don't have visibility into those broadcasts, we can't accurately say how many devices received it, which would be the correct value to increment in the existing total. So I think it makes sense to track how many broadcasts we issued and I think it's a complete different stat.

Wdyt?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each time we increment the existing total it means "one device got a push"

I think that's one way to interpret it, but "device" is not mentioned in either the stat name or the description, and I think it's actually more confusing that total isn't the total of the individually labelled stats.

If we want "device push" and "broadcast push" to be separated, I think we should make that more explicit (e.g. put the LiveActivity stats under push.broadcasts.xxx), but to be honest I think these legacy stats are already pretty confusing, and so perhaps do what you think is reasonable here and we should do this better in the (as yet unreleased) labelled stats.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"device" is not mentioned in either the stat name or the description

fair, I can adjust the description if you think it's worth it

to be honest I think these legacy stats are already pretty confusing, and so perhaps do what you think is reasonable here and we should do this better in the (as yet unreleased) labelled stats.

yeah I would prefer to not change things again and go "against" the legacy stats structure - do you agree we leave it like this now, which I think works fine even though it might still not be too obvious to the user but I don't think we can do better while adhering to the legacy stats structure - and try to improve later with labelled stats?

@JoaoDiasAbly
JoaoDiasAbly requested a review from lmars July 27, 2026 17:00

@lmars lmars left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants