MuleSoft App for Auto Discovery
This app is an extension of the MuleSoft integration enabled by the policy.
It ensures Treblle can discover all inactive/stale APIs and correctly capture API names inside Treblle for complete visibility and gives you the best Treblle experience.
Using the MuleSoft policy and this app together ensures you get 100% API visibility and a full Treblle experience across your MuleSoft environment.
Prerequisites
Section titled “Prerequisites”Before you begin, make sure you have:
- Configure the MuleSoft policy
- Access to Anypoint Platform
- Maven 3.8+ configured
- A Treblle account with API key and Project ID
Step 1: Clone Treblle Auto-Discovery Repository
Section titled “Step 1: Clone Treblle Auto-Discovery Repository”-
Clone the Treblle repository:
Terminal window git clone https://github.com/Treblle/treblle-mulesoft-autodiscovery.git -
Open the cloned repository in your development environment
Step 2: Obtain the JAR File
Section titled “Step 2: Obtain the JAR File”You have two options to get the required JAR file:
Option A: Build the Project
Section titled “Option A: Build the Project”- Save your changes
- Run the following command in your MuleSoft project directory:
Terminal window mvn clean install - Navigate to your
.m2folder and find the JAR file:treblle-register-apis-1.0.0-SNAPSHOT-mule-application.jar
Option B: Use Pre-built JAR from Repository
Section titled “Option B: Use Pre-built JAR from Repository”Alternatively, you can use the pre-built JAR file directly from the repository without building it yourself.
Step 3: Create Connected App
Section titled “Step 3: Create Connected App”- Go to Anypoint Platform Connected Apps
- Navigate to Access Management > Connected Apps
- Create a new app with the required information and scopes:
- Copy the Client ID and Client Secret - these will be needed for deployment:
Step 4: Deploy to Runtime Manager
Section titled “Step 4: Deploy to Runtime Manager”- Go to Runtime Manager and click Deploy Application
- Provide a name for the application and upload the JAR file:
treblle-register-apis-1.0.0-SNAPSHOT-mule-application.jar
Step 5: Configure Application Properties
Section titled “Step 5: Configure Application Properties”Go to the Properties section and add the following:
- CLIENT_ID: Your Connected App Client ID
- CLIENT_SECRET: Your Connected App Client Secret
- API_KEY: Enter your Treblle API key
- SDK_TOKEN: Enter your Treblle SDK token
- OrganizationId: Your MuleSoft Business Group ID
Click Deploy Application.
Step 6: Monitor Deployment
Section titled “Step 6: Monitor Deployment”- Once the app is deployed, click on it:
- Click on Logs to view all application logs:
For Multiple Business Groups
Section titled “For Multiple Business Groups”If you need to monitor APIs across different business groups, follow these additional steps:
Step 1: Build and Deploy the Treblle Policy on the business group that you want to add.
Step 2: Apply policy to the APIs.
(Refer to the MuleSoft policy documentation for detailed steps on how to apply policies to APIs)
Step 3: Update Connected App Scopes: Click the checkbox for different business groups to expand the scope permissions.
Step 4: Add Scopes for Other Business Groups: Ensure you add the same scopes for each business group you want to monitor.
Step 5: Configure Business Group IDs: In the connected app properties, add multiple business group IDs separated by commas (,).
Example: businessGroupIDs: group1-id,group2-id,group3-id
The logs will show different organization IDs when monitoring multiple business groups.
How It Works
Section titled “How It Works”The Treblle MuleSoft Auto-Discovery app automatically:
- Discovers APIs in your MuleSoft environment
- Registers them with the Treblle platform
- Monitors changes and updates API information
- Provides visibility into your API landscape
This enables smooth integration between your MuleSoft APIs and Treblle’s Intelligence.