MuleSoft Anypoint Platform Resource Usage and Metrics

Introduction

Anypoint Platform provides a rich set of platform APIs to facilitate deployment automation, log management, infrastructure management, and many more...Today we will take a look at a Mule utility that captures Anypoint resource usage metrics at Organization/Environment level.

metrics

Problem Statement

We are almost into the 5th year of APIfication journey on the MuleSoft Anypoint platform. As part of this journey, we have a team of Mulies engaged across programs to support apps running on different runtime versions in a federated C4E structure. While this has been a great model from a delivery standpoint; however, due to the hands-off approach sometimes resource utilization hasn't been optimal.

What's missing — A ability to extract a comprehensive view of resource usage on our platform at the organization level. As a result, we were unable to put controls to identify resource wastage (like — unnecessary resource-intensive configs left behind after load testing / high availability / static IPs, etc is configs, mostly in lower environments) or capture usage trends to derive accurate future projections.   

Approach

As stated above MuleSoft platform provides set of APIs to extract this information but not on click of a button and in a desired format (CSV, JSON, xml). So we decided to develop a utility to bridge this gap.

Solution

We have developed a utility API to capture MuleSoft Anypoint Platform usage metrics using Studio 7.5 & Mule 4.3 runtime. 

Key Features for this utility API:- 

api console

Utility orchestrates through below platform APIs to extract the information

anypoint platform

Below is a list of platform APIs resources being used.

# Anypoint Platform API Description
1 /accounts/login Generate Authorization Bearer token for Anypoint Platform
2

/accounts/API/me

Retrieve Organization Id
3

/accounts/API/organizations/{orgId}/environments

Retrieve a list of environments within Organization
4

/cloudhub/API/v2/applications

Retrieve application details for a particular environment

Conclusion

This utility provides an easy way to capture resource usage metrics which help Anypoint platform teams at an organization level to efficiently manage resources.

Hopefully, this provides a good insight on Anypoint Resource Usage Metrics API Utility. 

The code can be found here and Sample Response in CSV here. Please review README.md for configuration prerequisites.

 

 

 

 

Top