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. 

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.

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, 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.