Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/_data/schemas/frontmatter/base.json
Copy link
Contributor

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:

  • app/_assets/javascripts/apps/components/ProductIcon.vue
  • /icons/products/ will need the icon
  • app/_data/top_navigation.yml

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"type": "array",
"items": {
"type": "string",
"enum": ["ai-gateway", "gateway", "insomnia", "mesh", "kic", "catalog", "advanced-analytics", "dev-portal", "operator", "konnect", "event-gateway", "konnect-reference-platform"]
"enum": ["ai-gateway", "gateway", "insomnia", "mesh", "kic", "catalog", "advanced-analytics", "dev-portal", "operator", "konnect", "event-gateway", "konnect-reference-platform", "metering-and-billing"]
}
},
"tools": {
Expand Down
12 changes: 12 additions & 0 deletions app/_indices/metering-and-billing.yaml
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
14 changes: 14 additions & 0 deletions app/_landing_pages/metering-and-billing.yaml
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.
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
84 changes: 84 additions & 0 deletions app/metering-and-billing/subjects.md
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.

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.

## 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

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [base.Repetition] 'and' is repeated! Raw Output: {"message": "[base.Repetition] 'and' is repeated!", "location": {"path": "app/metering-and-billing/subjects.md", "range": {"start": {"line": 50, "column": 49}}}, "severity": "ERROR"}

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.

## Data ingestion

When shipping data to {{site.konnect_short_name}} you must include the subject within the payload:

```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

CRUD a subject here
Loading