Wednesday, December 2, 2026

#1199 - OIC tool for querying Billing service metric

Introduction 





The underlying metric is called -BilledMessageCount

This metric supports a couple of dimensions such as -

We can amend this query to group by integrationFlowIdentifier. This will return a response like - 

[ {
  "namespace" : "oci_integration",
  "name" : "BilledMessageCount",
  "dimensions" : {
    "integrationFlowIdentifier" : "ASYNC_CREATE_ORDER!01.00.0000"
  },
  "metadata" : {
    "displayName" : "Consumed Messages"
  },
  "resolution" : "",
  "aggregatedDatapoints" : [ {
    "timestamp" : "2026-12-01T08:00:00.000Z",
    "value" : 6125.0
  } ]
}, {
  "namespace" : "oci_integration",
  "name" : "BilledMessageCount",
  "dimensions" : {
    "integrationFlowIdentifier" : "GET_ASYNC_QUEUE_DEPTH!01.00.0000"
  },
  "metadata" : {
    "displayName" : "Consumed Messages"
  },
  "resolution" : "",
  "aggregatedDatapoints" : [ {
    "timestamp" : "2026-12-01T08:00:00.000Z",
    "value" : 13.0
  }, {
    "timestamp" : "2026-12-01T09:00:00.000Z",
    "value" : 1.0
  } ]
}, {
  "namespace" : "oci_integration",
  "name" : "BilledMessageCount",
  "dimensions" : {
    "integrationFlowIdentifier" : "GET_MESSAGES_RECEIVED_COUNT!01.00.0000"
  },
  "metadata" : {
    "displayName" : "Consumed Messages"
  },
  "resolution" : "",
  "aggregatedDatapoints" : [ {
    "timestamp" : "2026-12-01T08:00:00.000Z",
    "value" : 5.0
  } ]
} ]

I create an integration that invokes the OCI metric api - 

I set the query to - 

'BilledMessageCount[60m]{resourceId = "myOIC OCID"}.groupBy(integrationFlowIdentifier).sum()'

The invoke configuration - 

Request - 

Response - 

I expose the integration as a tool, get Claude to generate the skill, then test -

give me an overview of the billed messages from the last 24 hours

Here's the text - 

What stands out

- All of the cost is ASYNC_CREATE_ORDER. Everything else is a few dozen messages from the monitoring integrations, including the calls I just made.
- The load comes in bursts. 99.7% of the day's messages fell in 2 of the roughly 25 hours. Split evenly, the day's total would average about 1,000 messages per hour, well within 1 pack.
- The peak hour is exactly 3 × 6,125 (18,375). That looks like the same order batch ran three times in that hour, or a single run where each order counted as 3 messages (inbound payloads of about 100–150 KB). Comparing with the number of instances received would tell which.
- Whether this is really overage depends on your packs. With 4 or more non-BYOL packs, or 1 BYOL pack (20,000 per hour), no hour went over. Going over the packs also doesn't raise the concurrency limits, so the 14:30 burst probably built up a backlog in the async queue.

The next section - 

Here's the text - 

Next steps

1. Tell me how many message packs you have and whether they're BYOL, and I'll confirm whether any hour was really overage.
2. I can pull the number of instances ASYNC_CREATE_ORDER received at 14:30–15:30 CET to see whether it was 3 batches or larger payloads.
3. Spreading that batch load over several hours would keep it within fewer packs. An OCI alarm on BilledMessageCount would flag hours like these as they happen.

I ask for a dashboard -

and get the following - 

Summa Summarum

It just took me a couple of hours to get this up and running. I didn't review the skills, nor did I ask Claude to make any changes to the dashboard. So add in a couple of hours for such and then you have agent powered OIC Billing Observability. 















Tuesday, December 1, 2026

#1198 - OIC tool for querying AsyncQueueDepth metric

Introduction 

The claude output is based on a OIC tool, that itself leverages the OCI Service Metrics api. Let's begin by checking out the service metric - AsyncInboundRequestsDepth - 


This service metric can be accessed via the OCI console page for your OIC instance; just click on Monitoring - 

Let's expose this data as an agent tool. Firstly, you will need to give OIC access to service metrics; I've already done so, but the policies required are as follows -

allow any-user to read metrics in compartment <compartment-name>
  where all {request.principal.type = 'integrationinstance',
             request.principal.id   = '<OIC instance OCID>'}

allow group <group-name> to read metrics in compartment <compartment-name>
 

The REST connection is configured with the following base url -https://telemetry.us-phoenix-1.oraclecloud.com

Security is set to - 
The invoke is configured as follows - 

/20180401/metrics/actions/summarizeMetricsData

The response - 

[ {
  "namespace" : "oci_integration",
  "resourceGroup" : null,
  "compartmentId" : "yourCompartmentId",
  "name" : "AsyncInboundRequestsDepth",
  "dimensions" : {
    "resourceId" : "123"
  },
  "metadata" : {
    "displayName" : "Async Queue Depth"
  },
  "resolution" : null,
  "aggregatedDatapoints" : [ {
    "timestamp" : "2026-12-01T06:41:00.000Z",
    "value" : 0.0
  }, {
    "timestamp" : "2026-12-01T07:49:00.000Z",
    "value" : 5433.0
  }, {
    "timestamp" : "2026-12-01T07:50:00.000Z",
    "value" : 5433.0
  } ]
} ]

This is also the REST trigger response.

I expose the integration as an agent tool, get Claude to generate the relevant SKILL.md file, based on my input -

Now to testing - 

I ask - what is the current state of the async queue?

Here's the text - 

The async queue is draining. As of 09:25 CET it holds 2,040 messages, about 4.1% of the 50,000 limit for a 1-pack instance. It is going down by about 79 messages a minute, so it should be empty in about 26 minutes, around 09:51 CET, if nothing new arrives in a burst.

I looked at the last hour, 08:25–09:25 CET (07:25–08:25 UTC). All 61 one-minute readings are there, with no gaps. I don't know how many message packs the instance has, so I've measured against the 1-pack limit of 50,000, which is the worst case.


Findings
- Burst: Between 08:38 and 08:42 CET, about 5,900 messages arrived in 4 minutes. That's roughly 1,350 per minute coming in, more than the instance can process at once, so they waited in the queue. Queuing during a burst like this is normal.
- Peak: The highest point was 5,855 messages at 08:42–08:43 CET, 11.7% of the limit. There was no risk of new requests being rejected (HTTP 429).
- Drain rate: All drain rates are net of new arrivals, so OIC is actually processing faster than these numbers.
  - From 08:43 to 09:09 the queue went down slowly, at about 63 messages a minute.
  - From 09:09 to 09:13 it went down much faster, at about 310 a minute. Something freed up processing slots or arrivals dropped in those minutes.
  - Since 09:13 it has gone down by about 79 a minute (about 4,760 an hour).
  - Over the whole time since the peak, it averaged 91 a minute.
- No stuck periods: The depth stayed the same for only single minutes (08:49→08:50 and 09:02→09:03), then kept falling.
- Headroom: Even with only 1 pack, there is room for about 47,960 more messages.

Let's improve this...

We need insight into the queue, i.e. for which integrations are requests queued. Looking at OIC Observability - Integrations - 

The data shown is retrieved via a factory api - 

https://design.integration.yourRegion.ocp.oraclecloud.com/ic/api/integration/v1/monitoring/integrations?offset=0&limit=999&q={timewindow:'1h'}&orderBy=time&return=monitoringui&integrationInstance=yourOICInstance


I try out this api in Postman and see the following response -

{
    "dataFetchTime": "2026-12-01T13:17:57.885+0000",
    "items": [
        {
            "code": "ASYNC_CREATE_ORDER",
            "flowStatus": "ACTIVATED",
            "id": "ASYNC_CREATE_ORDER|01.00.0000",
            "lastUpdated": "2026-12-01T13:17:47.769+0000",
            "lastUpdatedString": "1 Dec 2026 13:17:47 GMT",
          ...
            "mepType": "MEP00",
            "name": "async create order",
            "noOfAborted": 41,
            "noOfErrors": 0,
            "noOfMsgsProcessed": 1961,
            "noOfMsgsReceived": 18375,
            "noOfSuccess": 1920,
            "optimizedVersion": "1.0",
            "projectCode": "AA_2604_NEW_FEATURES",
            "scheduleApplicable": false,
            "scheduleDefined": false,
            "successRate": 97,
            "version": "01.00.0000"
        },
        {
            "code": "SYNC_CREATE_ORDER_WITH_WAIT",
            "flowStatus": "ACTIVATED",
          ...

I create an integration, that uses this api and I expose it as a tool -

Again, I give Claude the relevant intel and ask it to generate the SKILL.md for this tool.

I then ask - what is the current state of the async queue? If filling up, which integration requests are being queued? 



Summa Summarum

As you can see, the combination of the service metrics API and the agent/LLM is very powerful. This is what ops folks want to know; not just how deep is the queue, but, also, what's queued and how quickly is it draining. They also need to monitor the queue depth in respect of the queue size limit. This tool covers all of these.

So from this - 

to this - 


is a great leap in intel offered, yet simple to implement.



 








Monday, November 30, 2026

#1197 - OIC tool to retrieve activity stream details

Introduction

This continues my set of posts on agent powered OIC observability. Today I'm looking at the monitoring api - get activity stream details - 

I run my create order integration, then execute the api in postman -

Here's an extract from the response -

Note the flowMilestones -
"flowMilestones": "r0,r0#m,s0Pre,sc0,w0Pre,s0Post,m1Pre,i0Pre,i0Post,m0Pre,y0#m,y0",

These milestones refer to the actions executed. You may notice some have pre and post entries.

Here is the integration - 

As you can see, r0 refers to message received (Trigger).

The code, r0#m, refers to message starts processing (Trigger).

The code, s0Pre, aligns to the SWITCH action. It's message is - Message entered Switch.

The code, sc0, aligns with the SWITCH condition route. 

The code, w0Pre, aligns with the WAIT action; it's message is Wait triggered.
The code, s0Post, aligns with the exiting of the SWITCH.  
The code, m1Pre, aligns with the MAP, before the Database invoke.
The codes, i0Pre and i0Post, refer to the INVOKE action.  
The code, m0Pre, aligns with the response MAP.
The code, y0#m, aligns with the response; its message is - Message sent to Reply.
The code, y0, aligns with the response; its message is - Reply to createOrder completed.

What does this look like, when I have an error? Let's resend order 100 - 

Note the error milestones etc.

I create an integration that invokes the api and I expose it as an agent tool - 

I get Claude to generate the relevant skills and expose the new tool thru my OIC MCP Gateway.

Let's execute the create order integration twice, with orderNrs 2112 and 3106.

Now to claude code - 


I ran the create order integration twice, once for orderNr 2112 and once for orderNr 3106. The instanceId for 3106
  is EkA9NeyYEfGp1FUNPB3CJg, the instanceId for 2112 is DBGZPuyYEfGRWO17ccV21Q. Why did 3106 take longer to execute?

Note the Findings - 


Findings:
- The Wait accounts for the whole difference. Without the 20.001 s Wait, order 3106 took about 308 ms, which is actually faster than order 2112's 576 ms. Most of 2112's time was a 391 ms gap between receiving the request and starting to process it (r0 → r0#m). That is normal startup variation, not a problem.
- The pattern across four runs: orders 3103 and 3106 both went through the Wait, and orders 100 and 2112 both skipped it. That fits a Switch condition based on the order number, for example a threshold somewhere between 2112 and 3103, or a rule for the 31xx range. The log only shows that the route taken has an empty condition (likely Otherwise), so the real rule is in the Switch definition in the designer.
- No errors, no child instances. Tracing is set to Production, so payloads weren't recorded.

If you want this confirmed from the data rather than four samples, I can pull CREATE_ORDER's integration stats. Runs that hit the Wait should show up as a cluster around 20 s, apart from the sub-second runs.

I reply - please do that -


This tool is great, however, it does require the instance id as request parameter. I want to make it easier to answer questions such as -  how did CREATE_ORDER in project AA_ANOMALY_DETECTION perform over the last 6 hours, and what caused any slow runs?

I create a new integration that leverages the get instances api - 
However, this time I query on integration e.g. https://design.integration.yourRegion.ocp.oraclecloud.com/ic/api/integration/v1/monitoring/instances?q={projectCode:'AA_ANOMALY_DETECTION',code: 'CREATE_ORDER', timewindow:'1h',+status:'COMPLETED'}&integrationInstance=yourOIC

This integration is then exposed as an Agent tool; as you can see, my toolkit is building up -


Back in claude code - how did CREATE_ORDER in project AA_ANOMALY_DETECTION perform over the last 6 hours, and what caused any slow runs?


All good, I then ask claude - > show me this on the nice chart you created for me


Looking up Project Integrations

Sometimes the user may not remember to which project an integration belongs; maybe she would simply like to enter a query such as - how was the performance of the create order integration over the last 1 day?

I added 2 new tools to my mcp server- list projects and list project integrations - 

These are based on the following 2 factory apis - 





I add these to Claude and then ask - 








I then ask -


Summa Summarum

Creating your own OIC Observability MCP server is easy, however, watch this space for product announcements in this space. 

Until then, Happy Monitoring!