[DX-883] Addresses message billing docs gap#3234
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@m-hulbert couple of questions for this one:
|
e85cf45 to
de53456
Compare
| Every message sent through Ably is counted for both publishing and delivery: | ||
|
|
||
| * 1 publish = 1 inbound message | ||
| * Each subscriber delivery = 1 outbound message per subscriber |
There was a problem hiding this comment.
+1 for each delivery to integrations (also applies to messages from log/stats metachannels)
|
|
||
| ## Message size <a id="message-size"/> | ||
|
|
||
| Message size is calculated as the sum of the `name`, `clientId`, `data`, and `extras` [properties](/docs/api/realtime-sdk/messages#properties) before any compression or expansion occurs in the serialization process. |
There was a problem hiding this comment.
LiveObjects and Annotations have different schemes
| | --- | --- | --- | | ||
| | Publish to channel | 1 inbound + 1 per subscriber outbound | Base cost for all messaging | | ||
| | Persisted message storage | +1 per message stored | Enable via [channel rules](/docs/storage-history/storage) | | ||
| | History retrieval | +1 per message retrieved | Each call to the [history API](/docs/storage-history/history) | |
There was a problem hiding this comment.
The wording on the last column may introduce confusion
| | Persisted message storage | +1 per message stored | Enable via [channel rules](/docs/storage-history/storage) | | ||
| | History retrieval | +1 per message retrieved | Each call to the [history API](/docs/storage-history/history) | | ||
| | Presence enter/leave/update | 1 inbound + 1 per presence subscriber outbound | Same counting as regular messages | | ||
| | Typing indicator heartbeat | 1 inbound + 1 per room member outbound | Controlled by `heartbeatThrottleMs` | |
There was a problem hiding this comment.
It feels weird to randomly throw in a Chat principle amid general platform pricing. Should there be a dedicated page for Chat pricing?
|
|
||
| Retrieving persisted messages via the [history API](/docs/storage-history/history) also counts: each message returned in a history response = 1 additional message. | ||
|
|
||
| To avoid persistence costs on messages that don't need history, mark them as [ephemeral](/docs/pub-sub/advanced#ephemeral). |
There was a problem hiding this comment.
But also don't need rewind, integrations and other functions - it's not just history
| * Subscribe to presence updates only on channels where you need member-level detail. | ||
|
|
||
| ## Chat-specific billing <a id="chat"/> | ||
|
|
There was a problem hiding this comment.
Worth a chat-specific page?
|
|
||
| Each chat message published to a room = 1 inbound + 1 per subscriber outbound. | ||
|
|
||
| Each typing indicator heartbeat event = 1 inbound + 1 per subscriber outbound. At the default 10-second heartbeat, one active typer generates approximately six events per minute. In a room with 50 subscribers, this is approximately **306 messages per minute** per active typer. |
src/data/nav/chat.ts
Outdated
| ], | ||
| }, | ||
| { | ||
| name: 'Message billing', |
There was a problem hiding this comment.
Is this the right level for this particular page, it feels a bit odd sitting here but maybe that's just me.
@m-hulbert WDYT?
|
I think my view on this is that we should have a page that covers all products (i.e. every operation that counts as a message) under the pricing section in Platform. Then from that we can create dedicated 'Pricing' pages under each product that cover 'what counts as a message' as well as a recap on channel and connection minutes (e.g. note that channels = rooms) and a section on cost optimisation for each product there. |
031b0df to
5e125be
Compare
m-hulbert
left a comment
There was a problem hiding this comment.
This is moving in the right direction Umair - just a few things to tidy up in terms of organisation and we're also only covering Pub/Sub and Chat in both places and not the other products?
This also seems quite dated, but we should make sure it's covered: https://faqs.ably.com/how-does-ably-count-messages
src/data/nav/chat.ts
Outdated
| ], | ||
| }, | ||
| { | ||
| name: 'Pricing', |
There was a problem hiding this comment.
I think it wouldn't hurt to prefix these with the product name in the nav, so "Chat pricing".
src/data/nav/platform.ts
Outdated
| }, | ||
| { | ||
| link: '/docs/platform/pricing/message-billing', | ||
| name: 'Message billing', |
There was a problem hiding this comment.
| name: 'Message billing', | |
| name: 'Message counting', |
| @@ -0,0 +1,111 @@ | |||
| --- | |||
| title: "Message billing" | |||
There was a problem hiding this comment.
| title: "Message billing" | |
| title: "Message counting" |
|
|
||
| All Ably products count messages for billing purposes. The following sections explain how operations across Pub/Sub, Chat, LiveObjects, and Annotations contribute to your message count. | ||
|
|
||
| <Aside data-type="further-reading"> |
There was a problem hiding this comment.
I'd delete this, as we're redirecting people as soon as they land on the page.
| intro: "How operations across all Ably products contribute to your message count." | ||
| --- | ||
|
|
||
| All Ably products count messages for billing purposes. The following sections explain how operations across Pub/Sub, Chat, LiveObjects, and Annotations contribute to your message count. |
There was a problem hiding this comment.
I think we should reword this around messages are a unit of consumption that we charge for and it's important to understand which operations count as messages.
|
|
||
| For Chat-specific cost optimization strategies, see [Chat pricing](/docs/chat/pricing). | ||
|
|
||
| ## LiveObjects operations <a id="liveobjects-operations"/> |
There was a problem hiding this comment.
We should keep the table format going throughout for consistency.
|
|
||
| | Operation | Messages counted | Notes | | ||
| | --- | --- | --- | | ||
| | Chat message | 1 inbound + 1 per subscriber outbound | Same as a standard publish | |
There was a problem hiding this comment.
I think we need to cover every possible operation on this page - e.g. edits/updates/deletes, moderation etc.
|
|
||
| ## Annotations <a id="annotations"/> | ||
|
|
||
| [Annotations](/docs/messages/annotations) have a different billing scheme from standard messages. See the [Annotations](/docs/messages/annotations) page for details on how annotation operations are counted. |
There was a problem hiding this comment.
I'm not sure why annotations are at the product level, nor why we're saying they are charged differently and linking to the annotations page which doesn't cover costs.
|
|
||
| [Annotations](/docs/messages/annotations) have a different billing scheme from standard messages. See the [Annotations](/docs/messages/annotations) page for details on how annotation operations are counted. | ||
|
|
||
| ## Persistence billing <a id="persistence"/> |
There was a problem hiding this comment.
These 2 sections should be covered in the tables really. I think we should review whether we need to have them dealt with separately. Reducing costs is something we should be handling on individual product pages.
| @@ -0,0 +1,41 @@ | |||
| --- | |||
There was a problem hiding this comment.
For these types of pages I think we should be able to lift and shift the product table from the 'main' page for how we count messages (integrations we may have to think about as it'll probably be a separate table... maybe link to that one?)
We should then have a section for channels (or rooms etc.) and connections that just states how they are charged. This will obviously be very light for Pub/Sub and connections in general, but the info already exists in the pricing page. For other products like Chat we obviously need to state that a channel = a room for billing purposes.
For the cost optimisation I really like this idea to include it, but would recommend that we have a short paragraph per item that briefly describes it and links out (rather than the table format), and would also say in this instance that we're missing the presence optimisations that you've initially covered on the main page (which occupancy would fall under as 1 option).
…mization strategies
m-hulbert
left a comment
There was a problem hiding this comment.
This is looking good Umair, just a few comments for consistency and tidy up.
- The comments on a few pages are applicable to them all (I think the first one I reviewed was Chat, so that has most)
- Can we add a dedicated page for LiveSync and AIT for consistency?
| meta_keywords: "chat pricing, message counting, typing indicators, reactions, cost optimization" | ||
| intro: "How Chat SDK features contribute to your message count and strategies to optimize costs." | ||
| redirect_from: | ||
| - /docs/chat/message-billing |
There was a problem hiding this comment.
You don't need this as that page never existed.
|
|
||
| The [Chat SDK](/docs/chat) is built on top of [Pub/Sub](/docs/pub-sub). All Chat operations generate Pub/Sub messages that follow the same counting rules. | ||
|
|
||
| <Aside data-type="further-reading"> |
There was a problem hiding this comment.
I'd suggest putting this after the table on message counting and dropping the second sentence about package comparisons.
| ## Rooms, channels, and connections <a id="rooms-connections"/> | ||
|
|
||
| Each Chat room maps to underlying Pub/Sub channels. Each room feature (messages, typing, reactions, presence, occupancy) uses its own channel, contributing to your [channel count](/docs/platform/pricing#channels). Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections) in the same way as Pub/Sub. |
There was a problem hiding this comment.
I think we should separate these out considering we charge for them independently. I also think it's worth having the explanations here rather than pushing people back to Pub/Sub to understand them.
|
|
||
| Increase the `heartbeatThrottleMs` [room option](/docs/chat/rooms#typing) to reduce typing indicator event frequency. The default is 10 seconds. Increase this value in rooms that tolerate delayed typing feedback. | ||
|
|
||
| ### Disable typing indicators |
There was a problem hiding this comment.
I'm not sure this needs to be stated, since they'd only be enabled if someone set them up.
|
|
||
| Each Chat room maps to underlying Pub/Sub channels. Each room feature (messages, typing, reactions, presence, occupancy) uses its own channel, contributing to your [channel count](/docs/platform/pricing#channels). Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections) in the same way as Pub/Sub. | ||
|
|
||
| ## Cost optimization <a id="optimization"/> |
There was a problem hiding this comment.
Is it worth adding some quick info on detaching from rooms and closing connections?
| <Aside data-type="further-reading"> | ||
| For package comparison and volume discounts, see the [pricing](https://ably.com/pricing) page. For general billing information, see [billing](/docs/platform/pricing/billing). | ||
| </Aside> | ||
|
|
||
| ## How Ably counts messages <a id="how-messages-are-counted"/> |
There was a problem hiding this comment.
Can delete these I think. It's not best practice to redirect someone as soon as they land on a page.
| | Token delivery | 1 outbound message per subscriber | | ||
| | [Persistence](/docs/storage-history/storage) storage | 1 additional message per stored message | | ||
|
|
||
| The total cost depends on the [token streaming pattern](/docs/ai-transport/token-streaming#token-streaming-patterns) you choose. With [message-per-response](/docs/ai-transport/token-streaming/message-per-response), [append rollup](/docs/ai-transport/token-streaming/token-rate-limits#per-response) conflates multiple tokens into fewer inbound messages. For example, 300 tokens published individually can be conflated to approximately 100 inbound messages. See the [AI support chatbot pricing example](/docs/platform/pricing/examples/ai-chatbot) for a full breakdown. |
There was a problem hiding this comment.
Is there anyway to distill this into the table (e.g. an entry for per token and for per response)?
Either way I don't think the pricing example is the appropriate place to link to for an explanation.
|
|
||
| [Channels](/docs/channels) are the unit of message distribution. Each channel you use contributes to your [channel count](/docs/platform/pricing#channels). Ably bills [connection minutes](/docs/platform/pricing#connections) per minute of connection time for each connected client. | ||
|
|
||
| ## Cost optimization <a id="optimization"/> |
There was a problem hiding this comment.
I think we should keep this to the specific product pages like you've done as some of these are only applicable to 1 or 2 products.
| meta_keywords: "message counting, pricing, persistence, presence, cost optimization, Pub/Sub pricing" | ||
| intro: "How Pub/Sub operations contribute to your message count and strategies to optimize costs." | ||
| redirect_from: | ||
| - /docs/pub-sub/message-billing |
There was a problem hiding this comment.
This didn't exist either.
|
|
||
| The following table shows how Chat operations contribute to your message count: | ||
|
|
||
| | Operation | Messages counted | |
There was a problem hiding this comment.
I'd suggest something like this format, to make the tables more readable and have fewer repeated links:
| Operation | Messages counted |
| --- | --- |
| [Pub/Sub](/docs/pub-sub) ||
| Publish | 1 inbound message |
| Message delivery | 1 outbound message per subscriber |
| [Presence](/docs/presence-occupancy/presence) ||
| Presence enter | 1 inbound message |
| Presence leave | 1 inbound message |
| Presence update | 1 inbound message |
| Presence event delivery | 1 outbound message per presence subscriber |
| [Message persistence](/docs/storage-history/storage) ||
| Persistence storage | 1 additional message per stored message |
| History retrieval | 1 message per retrieved message |
Description
Addresses message billing docs gap as per llm-eval docs audit
Checklist