Before you begin
- Create a meter with a sum aggregation whose value property is
$.value. CostGraph reports against its event type. - Price per cent, or divide by 100 downstream.
- Copy an API token from your OpenMeter settings. On Kong Konnect, use a
personal access token, which starts with
kpat_.
Connect
1
Connect the account
In Integrations, click OpenMeter and enter the API token. Leave
API URL empty for OpenMeter Cloud. For anything else, set it to the API
root including its version, not only the host:
- Self-hosted: your instance URL ending in
/api/v1 - Kong Konnect:
https://{region}.api.konghq.com/v3/openmeter, with the region of your Konnect organization
2
Bind a meter
Bind an
openmeter_ tag key to one of your meters. CostGraph lists meters
by event type.Tag spend by customer
The tag value must be an OpenMeter subject, the identifier for whoever the usage belongs to. OpenMeter creates a subject the first time it sees one, so a mistyped tag value becomes a new metered subject. Check the tag’s values before you bind the meter, and review what was reported after any rule change.Event payload
Each customer-day is one CloudEvent. Itssource is costgraph, its type
is the meter’s event type, and its subject is the tag value. The event
id is derived from the day and the totals, so a retried run is deduplicated.
The data carries value, the amount in cents, and the shared reconciliation
fields.
Corrections are sent as the difference and can be negative. The meter must
sum $.value for the total to settle.