Traefik Plugin
What you get with the plugin
This plugin allows you to integrate your Traefik Proxy with Treblle seamlessly so you can enjoy:
- Top-Notch Observability: Gain comprehensive insights into your API’s operations.
- Auto-Generated API Documentation: Automatically keep your documentation up-to-date with your API changes.
- Alerting and Notifications: Stay informed with alerts on crucial API events and changes.
Prerequisites
- Traefik: This plugin has been tested on v2 and v3
- Treblle Account
Installation
- Obtain your API key and SDK Token from Treblle
- Visit the Traefik Plugin Catalog
- Search for
Treblleand select Install. - Follow the displayed instructions to configure the plugin in your static and dynamic configurations.
- Restart your Traefik instance
- Enjoy!
Configuration
Parameter
Type and Description
ApiKey
string - Your API key obtained from Treblle (required)
SDKToken
string - Your SDK Token from Treblle (required)
AdditionalFieldsToMask
array - Additional sensitive fields to mask
RoutesToBlock
array - Paths to routes that should be hidden
RoutesRegex
string - Regex to match and hide specific routes
Example Usage
# Static configuration
experimental:
plugins:
treblle:
moduleName: "github.com/Treblle/TreblleTraefikPluginGo"
version: "{version-from-github-releases}"
# Dynamic configuration
http:
routers:
my-router:
entryPoints:
- http
middlewares:
- my-plugin
service: service-whoami
rule: Host(`localhost`)
services:
service-whoami:
loadBalancer:
servers:
- url: "http://localhost:8081"
passHostHeader: true
middlewares:
my-plugin:
plugin:
treblle:
ApiKey: "your-api-key"
sdkToken: "your-sdk-token"
AdditionalFieldsToMask:
- "accessToken"
- "refreshToken"
RoutesToBlock:
- "/api/user/login"
- "/ping"
RoutesRegex: "^/api/projects"Note
Make sure to replace your-api-key and your-sdk-token with your actual Treblle credentials.
Tip
Use the AdditionalFieldsToMask parameter to ensure sensitive data like tokens and passwords are properly masked in your API logs.