Introduction
Controlling costs is important, knowing where your universal credits are being spent is important.
Realising that overage is now charged is important. The OCI Billing Service Metrics for OIC make it easy for us to get a handle on all of this.
Just to remind you, we have the following Billing related service metrics for OIC -
- Configured Messages - based on Message Packs e.g. 1 Message Pack = 5k Messages
- Total Consumed Message Packs - actual Message Pack consumption, from a billing perspective i.e. Configured + any Overage
- Total Consumed Messages - consumed by all OIC components
- Consumed Messages for Integration - consumed by OIC Integration
- Consumed Message Packs for Disaster Recovery
- Consumed messages for Process Automation and Human in the Loop
- Consumed messages for Decisions
- Consumed messages for Robotic Process Automation
- Consumed messages from data retention
You may not be using all of the OIC components, so you can ignore some of the above.
Imagine if you are using OIC just for integrations, then the following billing metrics are relevant to you.
- Configured Messages - based on Message Packs e.g. 1 Message Pack = 5k Messages
- Total Consumed Message Packs - actual Message Pack consumption, from a billing perspective i.e. Configured + any Overage
- Total Consumed Messages - consumed by all OIC components
- Consumed Messages for Integration - consumed by OIC Integration
You may also be interested in the top nn integrations, from a billing perspective.
Here is the link to the Oracle documentation for OIC3 Billing, for those who want to recap on the charging rules.
Now let's begin by looking at the Service Metrics in more detail, as these are the basis for all the queries and dashboards I will create in this post.
OCI Billing Service Metrics for OIC
The 4 metrics above can be found, along with the others, in the service instance page in OCI Console. The service metrics for OIC can be divided into 2 broad types - Billing related and technical.
All metrics have filters - the time interval and the statistic. The filters applied by default differ between the metrics. For the Billing filters, the default time interval is one hour; this makes sense as billing is done on an hourly basis.
I just ran an integration 4 times in my Dev instance, so let's check the billing metric for integrations -
BilledMessageCount[60m]{resourceId = "yourOIC-OCID"}.grouping().grouping().sum()
I change the time interval to 1m -
I change the time interval to 1m -
Back to Edit Query mode -
Dimensions allow me to slice and dice the data. Each service metric will have a set of Dimensions one can use. These may differ between metrics.
Dimensions allow me to slice and dice the data. Each service metric will have a set of Dimensions one can use. These may differ between metrics.
For BilledMessageCount we have the following -
Net, net, we can breakdown the billed messages by integration.
I run a different integration 3 times, so that we have a choice here.
You can create OCI Alarms, based on these metrics -
BilledMessageCount[1m]{resourceId = "yourOIC-OCID", integrationFlowIdentifier = "CREATE_ORDER_NETSUITE!01.00.0000"}.grouping().sum() > 100
The Alarm can trigger various channels, via OCI Notifications / Subscriptions -
Net, net - your OIC admin will receive an email, if the sum of billed messages for the integration, CREATE_ORDER_NETSUITE!01.00.0000, exceeds 100.
Monitoring Billing via a Dashboard
We have a couple of options here - begin by entering Dashboard in the OCI Search box -
Click New Dashboard -
I now add 2 more widgets, based on the BilledMessagesCount metric. One for my OIC Dev instance, the other for Prod. I add the resourceId dimension to both, and set accordingly.
Net, net - here we have billed messages over all my OIC instances, as well as the sum for each instance.
Here's the data in tabular format -
The Configured Messages metric gives us the number of message packs assigned to a service instance. I add 2 widgets based on such, one for Dev and one for Prod -
We can also see the "offending" integration -
Remember, we could also have created an alarm on any of these so that the OIC admin is informed immediately.
Back to the dashboard we just created, the URL can be easily shared -
Back to the dashboard we just created, the URL can be easily shared -
Oracle Cloud Infrastructure (OCI) Management Dashboards are toolsets that display real-time and historical technical data through visual widgets. They focus on application health, resource performance, and deep log analytics.
These Dashboards can be seen as part of OCI Log Analytics, but the latter can do much more e.g. enable deep analysis of OIC Activity Stream logs. But we'll stick to the former here and create a similar billing dashboard.
You have 2 options for creating the dashboard, with or without filters. Log Analytics delivers a couple of OIC related dashboards OOTB. These dashboards can be viewed here, simply query on oracle integration.
The ones with Created by set to Oracle are the OOTB dashboards. The others were created by me. I did so by simply duplicating one of the OOTB dashboards.
Open one of the Oracle dashboards -
Note the filters available -
Log Group Compartment, OIC Environment (allows filtering on a specific OIC Instance), Integration Identifier (allows filtering on a specific integration), Integration Instance Id (allows filtering on a specific flow). With these filters we can start at fleet level, then drill down into a specific OIC service instance, from there to a specific integration etc.
I duplicate the Health Overview dashboard -
I can now add new Billing widgets-
As you can see, this is a similar interface to the Dashboards interface -
As you can see, this is a similar interface to the Dashboards interface -
We can overwrite this with - BilledMessageCount[60m]{resourceId = $(params.selectedOCID)}.grouping(resourceId).sum() -
Note the use of - resourceId = $(params.selectedOCID). This is allowing me to leverage the filter. Here's where I link selectedOCID to the actual filter OIC instance filter on the page -
Net, net - selectedOCID is just a variable I created. It is now linked to the OCID shown in the filter.
Let's clean this up; firstly, look at the entries with -, this means no billable messages for that hour. We can get rid of these, easily - add "preventFillGaps": true to the json source.
Now lets address the issue of the column names; I'll make them more user friendly. We need to edit the JSON source again -
The underlying query is - ConfiguredMessages[60m]{resourceId = $(params.selectedOCID)}.grouping().sum()
Now for a widget that displays the total consumed message packs -
BilledMessagePackCount[60m]{resourceId = $(params.selectedOCID)}.grouping().sum()
Here we see overage billed for 2 hours in the afternoon of the 24th of July.
Here's a widget that displays the total of consumed messages -
Here's a widget that displays the total of consumed messages -
TotalBilledMessageCount[60m]{resourceId = $(params.selectedOCID)}.grouping().sum()
I arrange the widgets as follows, so that it makes more sense -
I arrange the widgets as follows, so that it makes more sense -
We can see 5k messages configured (1 message pack), 7.192K messages for the 2 hours ending 04:30pm on July 25th, 1 extra message pack charged for each of those hours.
Next question to which we need an answer - which are the top integrations from a billing perspective?
The query for this is - BilledMessageCount[1h]{resourceId = $(params.selectedOCID)}.groupBy(integrationFlowIdentifier).sum().top_n(10)
The dashboard now contains 5 widgets -
Regarding the 5th widget, it's debatable whether we need it, but let's hang on to it for the present.
Here is where we can add more widgets, dependent on what other OIC components we are using.
I will add the following for OPA/HITL -
The underlying query - OPABilledProcessMessageCount[60m]{resourceId =$(params.selectedOCID)}.grouping().sum()
You could, of course, add widgets for RPA, Decisions and Disaster Recovery, if you are availing of those features.
I add these, for completeness sake.
This dashboard is available via OCI Management Dashboards and OCI Log Analytics -
As already mentioned, Log Analytics is a key tool for deeper analysis of your OIC activity stream logs; a tool I can very highly recommend. You can check out my other Log Analytics posts here.
Summa Summarum
I hope this post will be useful, please let me know if you think anything is missing. Net, net, the combination of dashboards and alarms can ensure you effectively monitor your OIC billing.

No comments:
Post a Comment