SubjectsOnly available in OpenMeter Cloud
Subjects in OpenMeter are entities that consume resources you wish to meter. These can range from users, servers, and services to devices. The design of subjects is intentionally generic, enabling flexible application across various metering scenarios. Typically, a subject acts as a unique identifier within your system for a user or customer.
Example subjects include:
- Customer ID or User ID
- Hostname or IP address
- Service or Application name
- Device ID
OpenMeter leverages subjects to establish connections with external systems (e.g., Stripe) and to maintain relevant metadata.
- Display Name: The subject's human-readable name is displayed within the user interface.
- Metadata: You can store additional details about the subject using key-value pairs.
- Stripe Customer ID: The Stripe Customer ID should be associated with the subject for integration with Stripe billing.
We recommend creating a subject when a new customer or user is created in your system and deleting a subject when a customer or user is deleted. Keeping the subjects in sync in OpenMeter is necessary if you synchronize usage to external systems, such as Stripe billing or CRMs, as OpenMeter knows the mapping between the subject and the external system.
When submitting data to OpenMeter, you must include the subject within your data payload.
OpenMeter adopts the CloudEvents format for data ingestion, incorporating the subject in the
When adding a new customer or user to your system, we recommend upserting the corresponding subject.
We recommend deleting a subject when a customer or user is deleted in your system. Deleting a subject won't delete the usage data associated with the subject.