-
Notifications
You must be signed in to change notification settings - Fork 76
Feat: Konnect metering and billing Subjects #3478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cloudjumpercat
merged 4 commits into
release/konnect-metering-and-billing
from
subject-reference
Nov 25, 2025
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| title: Metering and Billing Documentation Index | ||
| sections: | ||
| - title: Reference | ||
| items: | ||
| - path: /metering-and-billing/ | ||
| - path: /metering-and-billing/**/* | ||
| auto_exclude: true | ||
| - title: How-Tos | ||
| items: | ||
| - type: how-to | ||
| products: | ||
| - metering-and-billing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| metadata: | ||
| title: "Metering and Billing" | ||
| content_type: landing_page | ||
| description: Learn about managing service meshes and control planes with Metering and Billing. | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| breadcrumbs: | ||
| - /metering-and-billing/ | ||
| products: | ||
| - metering-and-billing | ||
|
|
||
| rows: | ||
| - header: | ||
| type: h1 | ||
| text: "Metering and Billing" | ||
| sub_text: Manage all of your {{site.mesh_product_name}} service meshes in a single console | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: "Subjects" | ||
| content_type: reference | ||
| description: "Learn how subjects work in {{site.konnect_short_name}} Metering and Billing and how they relate to usage tracking and external billing systems." | ||
| layout: reference | ||
| products: | ||
| - metering-and-billing | ||
| tools: | ||
| - konnect-api | ||
| works_on: | ||
| - konnect | ||
| breadcrumbs: | ||
| - /metering-and-billing/ | ||
| related_resources: | ||
| - text: "{{site.konnect_short_name}} Metering and Billing" | ||
| url: /metering-and-billing/ | ||
|
|
||
| --- | ||
|
|
||
| ## What is a subject? | ||
|
|
||
| Subjects represent the entity that produces usage in {{site.konnect_short_name}} Metering and Billing. | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| A subject can represent any unique event in your system, such as: | ||
| * Customer ID or User ID | ||
| * Hostname or IP address | ||
| * Service or application name | ||
| * Device ID | ||
|
|
||
| The subject model is intentionally generic, enabling flexible application across different metering scenarios. | ||
|
|
||
| In most implementations, a subject maps 1:1 with a customer or user in your system. | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## How do subjects work? | ||
|
|
||
| {{site.konnect_short_name}} Metering and Billing uses subjects to: | ||
|
|
||
| * Associate usage with external systems (for example, Stripe or CRM tools) | ||
| * Store descriptive metadata | ||
| * Identify the entity producing metered events | ||
|
|
||
| Each subject contains the following fields: | ||
|
|
||
| * **Key** – The subject’s unique identifier | ||
| * **Display name** – A human-readable label shown in the UI | ||
| * **Metadata** – Optional key-value attributes for additional context | ||
|
|
||
| ## Subjects and customers | ||
|
|
||
| In most cases, subjects are related to metering and and create usage. A customer, is related to billing and pays for usage. | ||
|
Check failure on line 50 in app/metering-and-billing/subjects.md
|
||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You can use the same identifier for both, but they can differ if your usage producer and billing entity are not the same. | ||
|
|
||
| For example: | ||
|
|
||
| * One customer may have multiple usage-producing subjects | ||
| * A single subject’s usage may need to be billed to a different customer | ||
|
|
||
| For more information, see **subject assignment** in the Metering and Billing documentation. | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Data ingestion | ||
|
|
||
| When shipping data to {{site.konnect_short_name}} you must include the subject within the payload: | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```ts | ||
| { | ||
| "specversion": "1.0", | ||
| "type": "api-calls", | ||
| "id": "00002", | ||
| "time": "2023-01-01T00:00:00.001Z", | ||
| "source": "service-0", | ||
| "subject": "customer-1", | ||
| "data": {...} | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ## Schema | ||
|
|
||
| [Insert Schema here](https://openmeter.io/docs/api/cloud#tag/subjects) | ||
|
|
||
| ## Set up a Route | ||
cloudjumpercat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| CRUD a subject here | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably doesn't matter for this PR, but I think we have to do more to bootstrap Metering and Billing: