apache / flagon-useralejs

Apache Flagon UserALE is a comprehensive, thin-client behavioral logging tool
https://flagon.apache.org/
Apache License 2.0
26 stars 26 forks source link

Karapace router #482

Closed EandrewJones closed 3 months ago

EandrewJones commented 4 months ago

Problem

We need to switch branches in order to make UserALE conform with TAP's Karapace Kafka proxy. This is inconvenient.

Solution

This PR adds a expressJS proxy server to the example folder that transforms the payload to conform to the expected Karapace Kafka proxy payload and will forward the payload to a user-supplied payload.

I multiplexed the existing example server docker container so that it can launch whichever node server the user specifies at runtime. Users can also pass additional arguments to the entrypoint script.

Example on how to launch the proxy:

docker build -t <image-tag-name> .
docker run \
-p 8000:8000 \
userale-test:latest example/karapace-router.js -f http://localhost:2727 -v 

The -f flag is where the user specifies the upstream url for the Karapace proxy, -v triggers verbose logs, -p specifies the port which defaults to 8000.