MuleSoft Anypoint Monitoring Basics
Anypoint Monitoring gives you real-time and historical visibility into all your deployed MuleSoft applications. It collects metrics, aggregates logs, generates dashboards, and sends alerts automatically. Every CloudHub deployment includes Anypoint Monitoring with no additional setup required.
Accessing Anypoint Monitoring
Log in to Anypoint Platform and click Monitoring in the left navigation. The Monitoring home page shows all applications deployed in the selected environment. Click any application to see its detailed dashboard.
Built-in Application Dashboard
Every deployed application automatically gets a built-in dashboard. You do not need to configure anything. The dashboard shows the four core metrics for every API and integration:
Built-in Dashboard Panels
Application: orders-api (Production) Last updated: 30 seconds ago ┌────────────────────────┬────────────────────────┐ │ Request Volume │ Response Time │ │ ████████ │ ──────────── │ │ 1,240 req/min │ Avg: 245ms │ │ (↑ 12% vs last hour) │ P95: 680ms │ │ │ P99: 1,240ms │ ├────────────────────────┼────────────────────────┤ │ Error Rate │ CPU Usage │ │ ████ │ ████████ │ │ 2.3% (↑ 0.4%) │ 67% (normal) │ │ 4xx: 1.8% │ │ │ 5xx: 0.5% │ Memory: 512MB / 1GB │ └────────────────────────┴────────────────────────┘
Key Metrics Explained
Request Volume
Shows how many requests your API receives per minute or per hour. Sudden spikes indicate unusual traffic — a marketing campaign launch, a client bug sending too many requests, or a potential attack. Drops may indicate a client is having trouble reaching your API.
Response Time
Measures how long the API takes to respond. Track both average and percentile metrics:
- Average: Typical response time. Can be misleading if a few very slow requests hide many fast ones.
- P95: 95% of requests complete within this time. A P95 of 800ms means 95 out of 100 requests finish in under 800ms.
- P99: 99% of requests complete within this time. The P99 shows your worst-case experience for most users.
Error Rate
The percentage of requests that result in HTTP 4xx or 5xx responses. Split by status code to understand the error type. A spike in 4xx errors usually means clients are sending bad requests. A spike in 5xx errors usually means your application or a dependency is failing.
Infrastructure Metrics
CPU, memory, and thread pool usage for the worker(s) running your application. High CPU sustained over time indicates the application needs more workers or optimization. High memory that keeps growing (never releasing) indicates a memory leak.
Log Search
Anypoint Monitoring's Log Search indexes all log output from all your CloudHub applications. Use it to search across all apps and environments simultaneously.
Log Search Interface
Log Search Query Bar:
[Search... ] [Last 1 Hour ▼] [Search]
Filters:
Application: [orders-api ▼] Level: [ERROR ▼] Environment: [Production ▼]
Results:
2024-01-15 09:45:22 ERROR orders-api [createOrderFlow]
{"event":"order_failed","correlationId":"req-xyz","error":"DB:CONNECTIVITY"}
2024-01-15 09:45:21 ERROR orders-api [createOrderFlow]
{"event":"order_failed","correlationId":"req-abc","error":"DB:CONNECTIVITY"}
2024-01-15 09:45:19 WARN orders-api [createOrderFlow]
{"event":"db_retry","attempt":2,"correlationId":"req-abc"}
Custom Dashboards
Build custom dashboards for metrics specific to your business. If your team cares about orders per minute, average order value, and SLA compliance — create a dashboard with those exact charts.
Creating a Custom Dashboard
- Click Custom Dashboards in the Monitoring left menu
- Click New Dashboard
- Enter a name:
Orders API Business Metrics - Click Add Chart
- Select chart type: Line, Bar, Single Value, or Table
- Select metric source: built-in metrics or custom metrics from your app
- Configure the query and time range
- Save and arrange charts on the dashboard
Custom Metrics from Your Application
Use the Custom Metrics feature to track business-level numbers in Anypoint Monitoring, not just technical metrics.
In your Mule application, use the Custom Metrics Connector:
[Custom Metrics: Record]
Application: orders-api
Metric Name: orders_processed
Value: 1
Type: COUNTER
Dimensions:
region: #[vars.region]
orderType: #[payload.type]
In Anypoint Monitoring, build a chart:
Metric: orders_processed
Group by: region
→ Bar chart showing orders by region in real time
Alerts in Anypoint Monitoring
Alerts notify your team when a metric crosses a threshold. Configure alerts for the conditions that matter most to your operation.
Alert Configuration Examples
Alert 1: High Error Rate
Application: orders-api
Environment: Production
Condition: error_rate_5xx > 5% for 5 minutes
Severity: Critical
Notify: Email → ops-team@mycompany.com
PagerDuty → on-call engineer
Alert 2: Slow Response
Condition: response_time_p95 > 3000ms for 10 minutes
Severity: Warning
Notify: Email → api-team@mycompany.com
Alert 3: High Memory
Condition: heap_used > 85% for 5 minutes
Severity: Warning
Notify: Email → platform-team@mycompany.com
Alert 4: Application Down
Condition: requests_received = 0 for 2 minutes
(no requests means app may be down)
Severity: Critical
Notify: PagerDuty + Email
Anypoint Monitoring Tiers
Anypoint Monitoring has two feature tiers:
- Gold (included with CloudHub): Built-in dashboards, Log Search with 30-day retention, basic alerts, and infrastructure metrics.
- Platinum (paid add-on): Custom dashboards, custom metrics, advanced log analysis, longer retention, and distributed tracing.
Distributed Tracing (Platinum)
Distributed tracing tracks a single request as it flows through multiple Mule applications. When a client calls Experience API → Process API → System API, tracing shows the time spent in each hop and exactly where latency occurs. This makes diagnosing performance issues across multi-API architectures much faster.
Distributed Trace View
Request: GET /customer/CUST-001/profile (total: 620ms)
│
├── mobile-exp-api: /customer/{id}/profile (35ms)
│ │
│ └── customer360-prc-api: /customers/{id}/fullProfile (580ms)
│ │
│ ├── salesforce-sys-api: /contacts/{id} (200ms) ← slowest
│ ├── oracle-sys-api: /customers/{id} (180ms)
│ └── oracle-sys-api: /orders?cid={id} (160ms)
│ (all 3 run in parallel via Scatter-Gather)
