KrakenD EE v2.8 released: Configurable logging, Redis-backed rate limits, Lua, YAML encoding and more
by Albert Lombarte
We are excited to announce the release of KrakenD Enterprise 2.8, packed with new features, upgrades, bug fixes, and some deprecations. Below is a breakdown of the updates.
Configurable access logs
The most acclaimed feature by our customers was the ability to customize the access log. This is why we have introduced in the new version a custom log format that allows you to define the string and fields you want to print in the stdlog. For instance, you can define an access_log_custom_format
like this:
%{time} | %{statusCode} | %{latencyMs} | %{clientIP} | %{method} %{path} %{jwt.sub}\n
By defining the pattern, you can design exactly what the log will look like.
Redis rate limits
KrakenD is a stateless software. However, there are a few times when customers need a stateful option regarding rate limiting. In addition to our existing behavior, we have added a stateful option backed in Redis to all our rate limits, including:
To simplify its monitoring, we have also added a Grafana Redis pool monitoring dashboard to improve visibility and diagnostics.
Lua enhancements
The new Lua Advanced Helpers bring powerful JSON, CSV, YAML, XML, time, base64, and hashing tools. These are implemented natively in Go for better performance. You can read a response string without needing external Lua source files and parse it as a JSON response with a single line. For instance:
local res = response.load()
local report = json.unmarshal(res:data():get("content"))
In addition, there are more upgrades to existing functions:
- The
custom_error
function supports a third parameter for specifying the content type. - The
headers(header,value)
setter accepts now anil
value to destroy headers. - The error log includes now a decorator showing the line and file where the error occurred.
- A new method,
keyExists
, is available as a helper for luaTable types.
API design enhancements
Finally, there are a few enhancements worth mentioning in this version that help in the API design and documentation phases:
- OpenAPI got better: The OpenAPI specification generation is now more powerful with richer customization options. When generating the docs, you can enrich a lot more the explanations about parameters, headers, and query strings, like adding
enum
,hide
, ortype
options. - Enhanced Postman collections: When generating collections, you can now group endpoints in folders and add descriptions to these folders.
- YAML Encoding Support: Because YAML is so extended that things like converting API responses into YAML files are a thing, we have added support both to read YAML encoding and converting content in YAML format (e.g., JSON to YAML), regardless of the original source.
- Moesif metadata: The Moesif integration now supports sending custom
metadata
with events.
With these updates and other improvements, such as the new gRPC introspection support or OpenTelemetry overrides, KrakenD Enterprise 2.8 aims to provide better control, performance, and developer experience. Dive into the documentation to explore these features further!
🚀 Summary of changes for EEv2.8
Configurable access log, all Rate Limits supporting Redis, improvements on Postman and OpenAPI, new Lua features, and more.
- Configurable access log field by field
- All rate limits support now a stateful option persisted on Redis: service, endpoints and tiered rate limits.
- New Grafana Dashboard to monitor Redis Pool Connections
- Postman collections can now add folders, group endpoints, descriptions, and a much richer generation
- The gRPC server supports now introspection, so clients no longer need to have Protobuf files locally.
- The new Lua Advanced Helpers add JSON, CSV, YML, XML, time, base64, and hashing functions with a native implementation in Go.
- Added a YAML encoding to read backend responses, but also to return content in YAML no matter the origin
-
Add a
rename
header function to themodifier/response-headers
-
The OpenAPI generation is now richer and more customizable thanks to multiple new parameters under
param_definition
,header_definition
, andquery_definition
, like addingenum
,hide
, ortype
. -
The Moesif integration adds a
metadata
attribute to send custom metadata with events. -
Lua - The
custom_error
function accepts now a third parameter to pass the content-type -
Lua - The function to set headers is able to destroy headers when passing a
nil
value. - Lua - Added an error log decorator to show the line and file where an error raised
-
Lua - Added the
keyExists
helper to checkluaTable
types. - OpenTelemetry has now the ability to override configuration at endpoint and backend level
- Upgraded Go to 1.22.10 (No security isses associated to the previous version so far)
- Lua - Conversion from tables to arrays instead of maps when tables have all indexes numeric
- OpenTelemetry - Several fixes on configuration overrides and multiErrors
-
The
check-plugin
command included an unnecessarygo
prefix before the version. - OpenAPI: Endpoint parameters are marked as always mandatory
-
The
letgoapp/influx
namespace, which was available for historical reasons, has been removed from the configuration schema. Rename it totelemetry/influx
for a quick fix (which is also deprecated), or upgrade to OpenTelemetry for a long-term solution. -
The
redis-ratelimit
based on theplugin/http-server
has transitioned to the new native Redis Service Rate Limit
Upgrading to the latest version is always advised.