How rudderlabs/rudder-transformer works
RudderStack Transformer is a service that turns RudderStack events into destination-specific events. Its principal workflow accepts transformation requests, selects a destination implementation, transforms events, and delivers requests to external integrations. The repository also contains source-event handling, user transformations, tracking-plan and regulation services, and custom-audience template evaluation. The README establishes the product purpose; the sampled excerpts and source index support only some internal connections, so unverified workflow links are dashed rather than presented as inspected calls.
Main entry points: nativeIntegration.ts Native Destination · index.ts Koa Server · serviceSelector.ts Service Selector · network.js Network Adapter
Components 20
HTTP Service
- Koa Server
src/index.ts - API Routes
src/routes - Destination API
src/controllers/destination.ts
Service Routing
- Service Selector
src/helpers/serviceSelector.ts
Transformation Services
- Native Destination
src/services/destination/nativeIntegration.ts - CDK v2 Destination
src/services/destination/cdkV2Integration.ts - Native Source
src/services/source/nativeIntegration.ts - Source Transforms
src/sources - User Transformations
src/services/userTransform.ts - Audience Templates
src/v0/destinations/custom_audience/template/templateEngine.ts - Tracking Plans
src/services/trackingPlan.ts - User Regulations
src/controllers/regulation.ts
Integrations
- Destination Transforms
src/v0/destinations - CDK v2 Destinations
src/cdk/v2/destinations - Network Adapter
src/adapters/network.js
Runtime Operations
- Metrics
src/util/stats.js - Prometheus Client
src/util/prometheus.js - Structured Logging
src/logger.js
Other components
- Event Sender
- External Destinations
Connections 20
- Event Sender → Koa Server: sends requests
- Koa Server → API Routes: mounts routes
src/index.ts - API Routes → Destination API: routes requests
- Destination API → Service Selector: selects service
- Service Selector → Native Destination: selects native
src/helpers/serviceSelector.ts - Service Selector → CDK v2 Destination: selects CDK v2
src/helpers/serviceSelector.ts - Service Selector → Native Source: selects source
src/helpers/serviceSelector.ts - Native Destination → Destination Transforms: dispatches transforms
- CDK v2 Destination → CDK v2 Destinations: dispatches handlers
- Native Source → Source Transforms: dispatches transforms
- Native Destination → User Transformations: applies functions
- Native Destination → Tracking Plans: validates events
- Native Destination → User Regulations: handles regulations
- Audience Templates → External Destinations: evaluates templates
- Destination Transforms → Network Adapter: prepares requests
src/v0/destinations/google_adwords_remarketing_lists/networkHandler.ts - CDK v2 Destinations → Network Adapter: prepares requests
- Network Adapter → External Destinations: sends requests
src/adapters/network.js - Koa Server → Metrics: records request stats
src/index.ts - Metrics → Prometheus Client: records metrics
src/util/stats.js - Koa Server → Structured Logging: logs errors
src/index.ts