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!







 

No comments: