MuleSoft
Monitor MuleSoft API Gateway traffic by applying the Alma Capture Policy (custom policy) and exporting telemetry via OTLP/HTTP.
Deploy Alma on MuleSoft to capture API gateway HTTP traffic without app code changes.
The Alma Capture Policy is a MuleSoft API Gateway custom policy.
It captures HTTP request/response metadata + payloads and exports them asynchronously to an OpenTelemetry Collector over OTLP/HTTP(S).
If you’re new to Alma, start with Alma Overview.
When applied to an API (or as an automated policy), the policy:
Intercepts inbound traffic at the Mule gateway.
Captures HTTP request metadata and payload data.
Invokes the downstream API (http-policy:execute-next).
Captures HTTP response metadata and payload data.
Exports captured telemetry asynchronously to an OpenTelemetry Collector.
The policy runs inline using the Mule 4 custom policy model (http-policy:proxy).
Telemetry export
Encoding: Protobuf (application/x-protobuf)
Typical collector endpoints:
https://<otel-collector-host>:4318/v1/traces
https://<otel-collector-host>:4318/v1/logs
MuleSoft Anypoint Platform permissions to:
upload a custom policy to Anypoint Exchange
apply policies in API Manager
Maven (mvn) installed (for Maven-based publishing).
An OpenTelemetry Collector reachable from Mule runtime over HTTPS on port 4318.
TLS trust configured so Mule trusts the collector’s certificate.
Install and apply the policy
MuleSoft supports multiple publishing workflows.
Use whichever matches your Exchange process.
For MuleSoft’s baseline flow, see: Upload a Custom Policy to Exchange.
1) Download and unzip the policy bundle
Download alma-mule-policy.zip from your Alma distribution channel.
You should see the standard Mule 4 custom policy structure (YAML, template.xml, Maven files, docs assets).
2) Publish the policy to Anypoint Exchange
Option A: Publish using Maven (recommended)
cd alma-mule-policy/<policy-name>
Update the groupId in pom.xml to your Anypoint Organization ID.
Ensure your Maven credentials are configured for Exchange.
Option B: Publish using Exchange APIs
If you automate publishing, upload the policy artifacts using Exchange APIs and bearer tokens.
3) Apply the policy in API Manager
Automated policy
Anypoint Platform → API Manager
Automated Policies → Add policy
Select Alma Capture Policy
API-specific policy
API Manager → select an API
Choose Alma Capture Policy
What data is exported
The policy exports standard OpenTelemetry signals:
Traces
request/response metadata
Logs
request and response payload data
correlated with trace/span identifiers
This keeps large payloads out of trace attributes, while preserving correlation.
Send traffic through the API.
Confirm the collector is receiving data on port 4318.
Confirm traces and logs appear in your backend.
Upgrade and uninstall
Publish a newer policy version to Exchange.
API Manager → select the API → Policies → Check for updates.
Apply the updated policy version.
API Manager → Policies → remove Alma Capture Policy.