Skip to content

[Usage-based] When payment is enabled, attribute all workspace instance usage to an explicitly selected "billing account" #10901

@jankeromnes

Description

@jankeromnes

Is your feature request related to a problem? Please describe

When payment is enabled, attribute all workspace instance usage to an explicitly selected "billing account".

Describe the behaviour you'd like

In #10533 and #10822, we've implemented a unique usage attribution ID for workspace instances, which attributes the instance's usage to either a user or a team.

This implemented "project-based attribution", which is the default attribution model we want e.g. in Self-Hosted:

Project-based attribution: If payments are not enabled (e.g. Self-Hosted), we attribute:
  - To the owner of the project (user or team), if the workspace is linked to a project
  - To the user, iff the workspace is not linked to a project

However, for usage-based billing, we want teams to be able to pay for 100% of their members' usage, regardless of whether their usage happens or a team project or something else (e.g. personal project, no project, ...).

For this, we need to implement "billing-based attribution", which we want for SaaS:

Billing-based attribution: If payments are enabled, we attribute all the user's usage to:
  - An explicitly selected billing account (e.g. a team with usage-based billing enabled)
  - Or, we default to the user for all usage (e.g. free tier or individual billing, regardless of project/team)

Describe alternatives you've considered

The alternative is to keep the "project-based attribution" like in Self-Hosted, where workspace instance usage gets attributed based on a project's ownership (regardless of billing status). We don't want this model when billing is enabled.

Additional context

Metadata

Metadata

Assignees

Labels

team: webappIssue belongs to the WebApp team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions