DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Avoiding Pitfalls With Java Optional: Common Mistakes and How To Fix Them [Video]
  • Auditing Tools for Kubernetes
  • Extending Java APIs: Add Missing Features Without the Hassle
  • Comparing Cloud Hosting vs. Self Hosting

Trending

  • Avoiding Pitfalls With Java Optional: Common Mistakes and How To Fix Them [Video]
  • Auditing Tools for Kubernetes
  • Extending Java APIs: Add Missing Features Without the Hassle
  • Comparing Cloud Hosting vs. Self Hosting
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. MuleSoft Anypoint Platform Resource Usage and Metrics

MuleSoft Anypoint Platform Resource Usage and Metrics

One-click Mule utility to capture Anypoint platform resource usage metrics for your organization or a specific environment.

Soumyajit Das user avatar by
Soumyajit Das
·
Jun. 29, 20 · Tutorial
Like (3)
Save
Tweet
Share
6.03K Views

Join the DZone community and get the full member experience.

Join For Free

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:- 

  • Generate a report at a regular interval based on a scheduled job.
  • Provides an API facade for realtime interaction that supports below resources.

api console

  • Complete resource usage metrics available at a click of a button.
  • Supports JSON, CSV & XML response formats.
  • Supports sending the report as an attachment via email.
  • These reports can be fed to DB / Tableau for visualization to identify usage trends.
  • Supports Anypoint credential-based authentication. It can be extended to support SAML assertion based authentication. Please refer links in the reference section.
  • Provides useful metrics like worker configurations, runtime support end date, static IP usage, binary version, etc per application.
  • Provides metrics at the organization level or for a particular environment like Dev, QA, UAT... (Sandbox), and Prod.
  • It provides vCore and active runtime being used for an environment. 

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.

Metric (unit) MuleSoft

Opinions expressed by DZone contributors are their own.

Trending

  • Avoiding Pitfalls With Java Optional: Common Mistakes and How To Fix Them [Video]
  • Auditing Tools for Kubernetes
  • Extending Java APIs: Add Missing Features Without the Hassle
  • Comparing Cloud Hosting vs. Self Hosting

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: