Starting off with a screenshot that is indecipherable may seem strange, but please humour me.
The screenshot shows some of the widgets from an OCI Logging Analytics Dashboard I created specifically for one of my OIC instances.
My goal was to give OIC admins the salient data they need in one dashboard. You can decide whether my "salient" applies to you, if not, you can certainly extrapolate from what I did.
I'll go through the widgets one by one, starting off with Billed Messages -
As you can see, I don't have many messages here. This is because I'm using one of my test instances. But, anyway, I see my exact billed message consumption.Let's look into what's powering this widget -
Let's create this in a new dashboard -
I give it a name - then I create a metric based widget - I don't see any data, so I choose a longer time window -Now I see some data -But let's go for a bar chart -Let's give it a title -
Now we change the statistic on the source data, as we want the message count -I then check for the last hour and see much fewer messages -Now back to editing the data source - I can also add more dimensions - integrationFlowIdentifier - allows me to get the stats for a specific integration.
adapterIdentifier - allows me to get the stats for integrations triggered by a specific adapter. All my demo app driven integrations is this instance have REST triggers, so I only see rest -
resourceId - the value shown here is the oic ocids. I only see 1, as I have only one OIC instance actively processing requests during this time window. I'll add this dimension, as this dashboard is for a specific OIC instance.I then click apply and see my widget in the dashboard -
Billed Messages are on an hourly basis so I change the time window to the last 24 hours - The next widget will break down these numbers by integration. This tells me where the money is being spent, from an integration perspective.We edit the dashboard -
and create a query based widget -Essentially, what I want is a pie chart showing the billed message breakdown, grouped by integration.So where will get this query from?
The easiest way is via the OCI Service Metrics, shown on your OIC instances' page in OCI -
I go to the consumed messages section - Here's the base query- Edit the query to add the group by integration - then click Create Alarm -this will open a dialogue to create an alarm based on the query. However, we will only copy the query -
Mine is as follows - BilledMessageCount[60m]{resourceId = "myOIC-OCID"}.grouping().sum()
Exit the Create Alarm screen and return to our dashboard - here we click Create query based widget -
Overwrite the query offered - with the following - BilledMessageCount[60m]{resourceId = "myOIC-OCID"}.grouping(integrationFlowIdentifier).sum()Change the Visualisation to Pie Chart - Save the widget, to return to the dashboard -I now increase the time window to 7 days. during this time I did some large load tests, using an integration, ProcessOrder.The dashboard tells me that, in the last 7 days, the ProcessOrder integration consumed 99.9% of the billable messages.
I change the time window to 3 days -
The next 2 widgets I add are related to technical messages and their breakdown by integration.There is a subtle difference between technical and billable messages e.g. an app driven integration that has a request payload of 80kb, counts as 2 billable messages, as it is over the 50kb limit.
These 2 new widgets will essentially be a variation on what we have already done for billed messages.
The next widget with be query based and here's the query -MessagesReceivedCount[60m]{resourceId = "your-OIC-OCID"}.grouping(flowCode).sum()
Note the group by here is using flowCode and not integrationFlowIdentifier, however, both refer to the integration.
Adapter Errors - I check here for outbound invokes that have a response status of http 500.
NumberOfOutboundRequests[5m]{resourceId = "ocid1.integrationinstance.oc1.phx.myOIC-OCID", outboundInvocationResponseStatus = "500"}.sum()
Adapter Errors by Integration - this uses the same query, but has the following configuration -
One can also create more generic error widgets - Failed Messages - is a widget based on the service metric, MessagesFailedCount. Failed Messages by Integration - is a query based widget. The query is as follows -
MessagesFailedCount[5m]{resourceId = "ocid1.integrationinstance.oc1.phx.myOIC-OCID"}.sum()
Configuration is as follows -
Finally let's consider the situation, where I've literally 100s of integrations running in production. The pie charts I've used my not be all that appropriate. However, I can amend the queries to just show the top 5 or 10 integrations etc.Just amend the queries as follows -
BilledMessageCount[1m].grouping(integrationFlowIdentifier).sum().top_n(5)
Note that only 4 integrations are listed above.Now to the Technical Messages - Top 5 Integrations widget - here the query is - MessagesReceivedCount[1m].grouping(flowCode).sum().top_n(5)
Note, I see 5 integrations here, the extra one is a scheduled job that just reads a very small file, < 50kb, hence not chargeable.
Quo Vadis? Gen2 Usage Metrics?
No comments:
Post a Comment