Julian Lyndon-Smith (whoGloo Limited) asked a question.

pasoe metrics endpoint not working

I spent quite soem time trying to get a pasoe mettrcs endpoint to work, only subsequently to find this KB,

 

 

https://community.progress.com/s/article/PASOE-The-Get-OEABL-WebApp-Metrics-operation-of-the-OEMANAGER-REST-API-always-returns-HTTP-500-error

 

 

Me being me, I thought I'd spend my friday night poking around :) 

 

 

When we fire off this request: GET /oemanager/applications/sportsdemo/webapps/ROOT/metrics

 

It falls over and returns:Unable to find OEABL service [ ROOT ] with the operation: GET OE_BROKER METRICS

 

However, the WebApp itself is definitely registered properly. If you query it directly: GET /oemanager/applications/sportsdemo/webapps

 

It successfully returns the WebApp as expected:

 

name= ROOT

applicationName= sportsdemo

oetype= WEBAPP

 

 

I had a rummage through the implementation shipped with 12.8.8 to see where it's getting its wires crossed. The REST resource ultimately calls:

 

OeablServiceManager.getMetrics(appName, webAppName) Inside OeablServiceManager.getMetrics(String,String)

 

the code performs the equivalent of serviceRegistry.getService(webAppName) and then attempts to cast the returned object to a WebApp

 

If you look at com.progress.appserv.services.naming.ServiceRegistry in oenaming-12.8.8.jar, getService(String) is just a straightforward lookup against a flat ConcurrentHashMap<String,Object>. 

 

It is effectively just doing: registry.get(name) The kicker here is that the appName argument passed into OeablServiceManager.getMetrics doesn't actually participate in this lookup at all. It's completely ignored.

 

Consequently, when we pass: 

 

appName = sportsdemo 

webAppName= ROOT

 

The implementation just blindly executes registry.get("ROOT"), rather than correctly resolving the ROOT WebApp within the sportsdemo application context. This completely explains our OCTA-46760 error "Unable to find OEABL service [ ROOT ]").

 

To prove I'm not talking rubbish, there's a cracking little test that confirms this conclusively. If I deliberately lob in this request:

 

GET /oemanager/applications/sportsdemo/webapps/sportsdemo/metrics

 

The registry lookup suddenly succeeds. Why? Because sportsdemo is a top-level registered OEABL application. The code then falls over immediately afterwards because the cast fails (the object returned is an Application, not a webApp.

 

So it boils down to these two scenarios:

 

ROOT → registry lookup fails →

Unable to find OEABL service [ROOT]

sportsdemo → registry lookup succeeds → Application is incorrectly cast to WebApp, causing a cast exception.

Bottom line: The root cause of OCTA-46760 is that

 

OeablServiceManager.getMetrics(String appName, String webAppName) is incorrectly treating webAppName as a top-level ServiceRegistry key, effectively tossing the appName out the window when resolving the WebApp.

 

HTH 


Peter Judge and Mike Fechner like this.