Validating a usage-based deployment
You can confirm if a usage-based deployment is operating as expected by checking the logs and the /ready
endpoint of a running Event Gateway Service.
When starting, the Event Gateway Service logs if it is operating in usage-based mode. If it is, the gateway will perform an initial test of the provided configuration settings. The following is an example of a successful check:
...
<DATETIME> INFO com.ibm.eem.UBP Collector - [configReceived:130] Usage Based Pricing enabled : License Service reporting usage to: <ENDPOINT>
...
<DATETIME> INFO com.ibm.eem.UBP Collector - [lambda$configReceived$4:138] Usage Based Pricing configuration test successful.
...
If at any time an issue occurs when reporting metrics, including the initial test, a message is written to the logs, detailing the cause of the error, and the payload which was being sent. The following is an example of an error message:
...
<DATETIME> WARN com.ibm.eem.UBP Collector - [lambda$sendMetrics$16:256] Failed to send data to the license service : <ENDPOINT> : <ERROR> : <PAYLOAD>
Note: If an error occurs when submitting the number of API calls to the Licensing Service, the actual number of API calls made is not lost. They will be reported, in addition to any new API calls, in the next submission.
This message and status is also available in the Event Gateway Service /ready
endpoint on port 8081, under the UBP.Reporting.Status
ID. This endpoint can be queried at any time. The following is an example query:
oc exec $(oc get pod -l app.kubernetes.io/instance=<INSTANCE>-egw -n <NAMESPACE> -o name) -n <NAMESPACE> curl http://localhost:8081/ready
The result will return the current status of the gateway. The following is an example result of a healthy system with usage-based licensing configured:
{
"code" : 200,
"body" : {
"components" : [ {
"id" : "KafkaClient",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
}, {
"id" : "UBP.Reporting.Status",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
}, {
"id" : "GATEWAY_REGISTERED",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
}, {
"id" : "GatewayRegistrationService",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
} ],
"readyComponentCount" : 4,
"notReadyComponentCount" : 0,
"code" : 200,
"status" : "ok"
}
}
The following is an example result of a system that has usage-based licensing configured, but is running with errors:
{
"code" : 503,
"body" : {
"components" : [ {
"id" : "KafkaClient",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
}, {
"id" : "UBP.Reporting.Status",
"description" : "Failed to send data to the license service : https://ibm-licensing-service-instance.ibm-common-services.svc.cluster.local:8089/v2/metric_upload?token=cEDdqE9sodSl8n87Vz82Im39 : No route to host: ibm-licensing-service-instance.ibm-common-services.svc.cluster.local/172.30.42.210:8089 : {\"cloudpakId\":\"279abae6bfe647eca1f0efcbf136099c\",\"cloudpakName\":\"IBM Cloud Pak for Integration - API Calls\",\"productId\":\"3af7dda8ce3e4369b1c461c2982719c8\",\"productName\":\"IBM Event Endpoint Management Non Production\",\"productMetric\":\"MONTHLY_API_CALL\",\"productCloudpakRatio\":\"2:1\",\"cloudpakMetric\":\"RESOURCE_VALUE_UNIT\",\"aggregationPolicy\":\"ADD\",\"metricValue\":0}",
"code" : 500,
"conditions" : [ ]
}, {
"id" : "GATEWAY_REGISTERED",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
}, {
"id" : "GatewayRegistrationService",
"description" : "ok",
"code" : 200,
"conditions" : [ ]
} ],
"readyComponentCount" : 3,
"notReadyComponentCount" : 1,
"code" : 503,
"status" : "Not ready"
}
}
How usage is recorded and charged
Usage metrics are reported to the IBM License Service at regular intervals by the Event Gateway Service. See Configuring Reporting Frequency for more information about when usage is reported.
Each event delivered to a client application instance will count as a single API Call.
If the client application makes a request that results in an error being returned (and not an event being delivered), then the request will not be counted as an API call.
If the client requests an event and disconnects while an event is in the process of being delivered, this will still be counted as an API call.
If the client requests a batch of events (i.e. more than one), this will be counted as the number of events passed to the client.
To prevent unexpected charges, ensure you have the required entitlement for the number of events that are processed.
Tracking, monitoring and auditing usage
Usage is tracked and charged based on the number of API calls handled by Event Endpoint Management. For more information about how you might be charged, see details about API calls in the license information document. In usage-based mode, usage is reported automatically to the IBM License Service, where usage can be tracked, monitored, and audited.
Configuring reporting frequency
For usage-based tracking deployments, you can set how frequently usage is reported to the License Service. The default is 3600
seconds (1 hour). You can set the frequency by amending the ConfigMap for the Event Gateway Service and changing the following value:
submitInterval
: Defines how frequently the gateway submits usage metrics. (Default:3600
(seconds) - submit hourly)
You can edit this value by running the following command and changing the value in the config
field:
oc edit configmap $(oc get configmap -l app.kubernetes.io/instance=<INSTANCE>-egw -o custom-columns=POD:.metadata.name --no-headers) -n <NAMESPACE>