Get started with Datakit
Available with Kong Gateway Enterprise subscription - Contact Sales
This feature is released as a tech preview (alpha-quality) and should not be depended upon in a production environment.
Enable the WASM engine
In kong.conf
, set:
wasm = on
Or export the setting via an environment variable:
KONG_WASM=on
Reload or start Kong Gateway to apply the configuration.
Create a service and a route
Enable Datakit
Let’s test out Datakit by combining responses from two third party API calls, then returning directly to the client.
Validate
Access the service via the route my-route
to test Datakit:
curl -i http://localhost:8000/my-route
You should get a 200
response with a random fact from each fact generator called in the config:
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 432
Content-Type: application/json
Date: Fri, 06 Dec 2024 18:26:48 GMT
Server: kong/3.9.0.0-enterprise-edition
Via: 1.1 kong/3.9.0.0-enterprise-edition
X-Kong-Proxy-Latency: 744
X-Kong-Request-Id: 878618103ee7137b7c2f914e107cb454
X-Kong-Upstream-Latency: 742
{
"cat_fact": "The longest living cat on record according to the Guinness Book belongs to the late Creme Puff of Austin, Texas who lived to the ripe old age of 38 years and 3 days!",
"dog_fact": "Greyhounds can reach a speed of up to 45 miles per hour."
}