Website • Documentation • Pricing
Treblle is an API intelligence platfom that helps developers, teams and organizations understand their APIs from a single integration point.
| WSO2 API Manager Version | Status | Maven Profile | APIM Version | Synapse Version |
|---|---|---|---|---|
| 3.2.x | ✅ Supported | wso2am-3.2 |
6.7.206 | 2.1.7-wso2v183 |
| 4.0.x | ✅ Supported | wso2am-4.0 |
9.0.0 | 4.0.0-wso2v100 |
| 4.1.x | ✅ Supported | wso2am-4.1 |
9.1.0 | 4.0.0-wso2v102 |
| 4.2.x | ✅ Supported | wso2am-4.2 |
9.2.0 | 4.0.0-wso2v103 |
| 4.3.x | ✅ Supported (Default) | wso2am-4.3 |
9.29.120 | 4.0.0-wso2v105 |
| 4.4.x | ✅ Supported | wso2am-4.4 |
9.31.0 | 4.0.0-wso2v106 |
Note: The extension uses Maven profiles to support multiple WSO2 versions. By default, it builds for WSO2 APIM 4.3.x.
This extension integrates with WSO2's Global Synapse Handler to intercept API requests and responses at the gateway level. It operates asynchronously to ensure zero impact on API performance.
- Request Capture - Intercepts incoming API requests, capturing headers, body, IP, method, and path
- Response Capture - Captures response data including status code, headers, body, and load time
- Async Processing - Adds captured data to a bounded in-memory queue (non-blocking)
- Worker Threads - Background threads dequeue events and send them to Treblle
- Retry Logic - Retries failed sends once (1 second delay), then drops the event
- Data Masking - Automatically masks sensitive fields before transmission
- Non-blocking: Never blocks or slows down API requests, even on failures
- Thread-safe: Uses concurrent queues and atomic operations
- Load-balanced: Distributes traffic across multiple Treblle endpoints
- Sensitive data masking: Automatically redacts passwords, tokens, credit cards, etc.
- Multi-tenant support: Filter by tenant domains
- Configurable: Queue size, worker threads, custom endpoints, and masking rules
- WSO2 API Manager 4.3.x installed
- Java 8 or higher
- Maven 3.x (for building from source)
- Treblle account with SDK token and API key (Get started)
Execute the following command from the root directory:
mvn clean installThe JAR artifact will be created in the target/ directory as treblle-data-publisher-4.3.x-1.0.0.jar
Use Maven profiles to build for specific WSO2 API Manager versions:
# For WSO2 APIM 3.2.x
mvn clean install -P wso2am-3.2
# For WSO2 APIM 4.0.x
mvn clean install -P wso2am-4.0
# For WSO2 APIM 4.1.x
mvn clean install -P wso2am-4.1
# For WSO2 APIM 4.2.x
mvn clean install -P wso2am-4.2
# For WSO2 APIM 4.3.x (default)
mvn clean install -P wso2am-4.3
# For WSO2 APIM 4.4.x
mvn clean install -P wso2am-4.4The JAR artifact name will include the version suffix (e.g., treblle-data-publisher-3.2.x-1.0.0.jar).
To build artifacts for all supported versions:
mvn clean install -P wso2am-3.2,wso2am-4.0,wso2am-4.1,wso2am-4.2,wso2am-4.3,wso2am-4.4Important: Ensure you deploy the correct JAR artifact that matches your WSO2 API Manager version.
Copy the built JAR artifact that matches your WSO2 version to your API Manager gateway:
# Example for WSO2 APIM 4.3.x (default)
cp target/treblle-data-publisher-4.3.x-1.0.0.jar <APIM_HOME>/repository/components/lib/
# For other versions, use the appropriate JAR file
# cp target/treblle-data-publisher-3.2.x-1.0.0.jar <APIM_HOME>/repository/components/lib/
# cp target/treblle-data-publisher-4.0.x-1.0.0.jar <APIM_HOME>/repository/components/lib/Replace <APIM_HOME> with your WSO2 API Manager installation directory.
Add the following configuration at the beginning of <APIM_HOME>/repository/conf/deployment.toml:
Important: This must be placed at the beginning of the file to ensure the handler is registered before other handlers.
[synapse_handlers.treblle_publisher]
enabled=true
class="com.treblle.wso2publisher.handlers.APILogHandler"Add the following to <APIM_HOME>/repository/conf/log4j2.properties:
Note: This enables Treblle extension logs in the default wso2carbon.log. You can create a custom appender for separate log files.
loggers = treblle_publisher, AUDIT_LOG, ...
logger.treblle_publisher.name = com.treblle.wso2publisher
logger.treblle_publisher.level = INFO
logger.treblle_publisher.appenderRef.CARBON_LOGFILE.ref = CARBON_LOGFILEBefore starting the WSO2 API Manager, configure the required environment variables.
macOS / Linux:
export TREBLLE_SDK_TOKEN=your-sdk-token
export TREBLLE_API_KEY=your-api-key
export TREBLLE_GATEWAY_URL="https://your-gateway.com" # Optional
export TREBLLE_QUEUE_SIZE=20000 # Optional
export TREBLLE_WORKER_THREADS=1 # Optional
export ADDITIONAL_MASK_KEYWORDS=customToken,apiSecret # Optional
export TREBLLE_ENABLED_TENANT_DOMAINS=carbon.super # OptionalWindows:
set TREBLLE_SDK_TOKEN=your-sdk-token
set TREBLLE_API_KEY=your-api-key
set TREBLLE_GATEWAY_URL=https://your-gateway.com
set TREBLLE_QUEUE_SIZE=20000
set TREBLLE_WORKER_THREADS=1
set ADDITIONAL_MASK_KEYWORDS=customToken,apiSecret
set TREBLLE_ENABLED_TENANT_DOMAINS=carbon.superStart your WSO2 API Manager gateway:
cd <APIM_HOME>/bin
./api-manager.sh # or api-manager.bat on WindowsCheck the logs to verify the extension loaded successfully. You should see Treblle-related log entries in wso2carbon.log.
| Environment Variable | Description | Required | Default |
|---|---|---|---|
TREBLLE_SDK_TOKEN |
Your Treblle project SDK token | Yes | - |
TREBLLE_API_KEY |
Your Treblle project API key | Yes | - |
TREBLLE_GATEWAY_URL |
Custom Treblle endpoint URL | No | Auto load-balanced endpoints |
TREBLLE_QUEUE_SIZE |
Maximum in-memory queue size for events | No | 20000 |
TREBLLE_WORKER_THREADS |
Number of background worker threads | No | 1 |
ADDITIONAL_MASK_KEYWORDS |
Additional fields to mask (comma-separated) | No | See below |
TREBLLE_ENABLED_TENANT_DOMAINS |
Tenant domains to monitor (comma-separated) | No | All domains |
The following keywords are automatically masked in headers and request/response bodies:
password,pwd,secret,password_confirmationcc,card_number,ccvssn,credit_score
Use ADDITIONAL_MASK_KEYWORDS to add more (e.g., Authorization,X-API-Key,token).
Load Balancing (Default):
If TREBLLE_GATEWAY_URL is NOT set, the extension automatically load-balances across Treblle's endpoints:
https://rocknrolla.treblle.comhttps://punisher.treblle.comhttps://sicario.treblle.com
Custom Endpoint:
If TREBLLE_GATEWAY_URL is set, all data is sent to your specified endpoint:
export TREBLLE_GATEWAY_URL="https://custom-treblle.your-domain.com"Use cases: On-premise Treblle installations, custom routing, regional endpoints, or development testing.
Check logs in <APIM_HOME>/repository/logs/wso2carbon.log:
grep -i treblle wso2carbon.log
Verify JAR location:
ls -la <APIM_HOME>/repository/components/lib/treblle-data-publisher-*.jar
# Ensure the version matches your WSO2 APIM versionVerify deployment.toml configuration is at the beginning of the file.
-
Verify environment variables are set:
echo $TREBLLE_SDK_TOKEN echo $TREBLLE_API_KEY
-
Check for errors in logs:
grep -i "treblle.*error" wso2carbon.log -
Verify tenant domain filtering (if using
TREBLLE_ENABLED_TENANT_DOMAINS):- Ensure your API's tenant domain is in the allowed list
- Default tenant is usually
carbon.super
-
Check content type - Only
application/jsonrequests/responses are captured
If you see "Event queue is full" errors:
-
Increase queue size:
export TREBLLE_QUEUE_SIZE=50000 -
Add more worker threads:
export TREBLLE_WORKER_THREADS=2 -
Check network connectivity to Treblle endpoints
If experiencing memory pressure:
- Reduce
TREBLLE_QUEUE_SIZE(default 20,000) - Reduce
TREBLLE_WORKER_THREADS(default 1) - Use
TREBLLE_ENABLED_TENANT_DOMAINSto filter which APIs are monitored
mvn testmvn test -Dtest=APILogHandlerTest
mvn test -Dtest=PublisherClientTestIf you continue to experience issues:
- Enable
debug: trueand check console output - Verify your SDK token and API key are correct in Treblle dashboard
- Test with a simple endpoint first
- Check Treblle documentation for the latest updates
- Contact support at https://treblle.com or email support@treblle.com
If you have problems of any kind feel free to reach out via https://treblle.com or email support@treblle.com and we'll do our best to help you out.
Copyright 2025, Treblle Inc. Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php