The FireTail KrakenD plugin integrates with the KrakenD API Gateway to enhance logging, validation, and observability. This guide provides step-by-step instructions to compile, configure, and verify the plugin on your system.
To build the FireTail KrakenD plugin, use the official KrakenD builder image available from Docker Hub. Ensure the version of the FireTail KrakenD builder image matches the version of KrakenD runtime image you are using. Using mismatched versions will cause the plugin to fail to load at runtime.
Clone the GitHub Repository
Clone the FireTail KrakenD plugin’s GitHub repository to download a copy of the source code:
After cloning the repository, change directory into the cloned repository:
Run Docker Command
Use the docker run command, ensuring the versions of the krakend/builde
r match the FireTail KrakenD builder image:
Running this command should yield a new file called firetail-krakend-plugin
with a .so
file extension.
When the FireTail KrakenD plugin is compiled, use the binary it created (firetail-krakend-plugin.so
) with the official KrakenD docker image.
FireTail’s GitHub repository contains an example krakend.json and appspec.yaml in the example directory. Use this to check if the plugin is working.
Move the FireTail KrakenD plugin binary into the example directory.
Use the docker run
command below to run the official KrakenD runtime image with the FireTail KrakenD plugin, using the KrakenD configuration JSON and OpenAPI specification included in the example directory.
Note: The example directory also includes an OpenAPI specification, and the FireTail KrakenD plugin has been configured to load this OpenAPI specification.
Make a request to its health endpoint using the following curl command:
You should receive a response similar to the example below, with a now
property holding the current time as a date string, and a status
property with a value of ok
.
After confirming that KrakenD is running correctly, the FireTail KrakenD plugin can be verified.
example
directory of the FireTail KrakenD plugin’s GitHub repository.In the example above, the request failed as the request body did not include a name property, which is required, as described in the OpenAPI schema.
The example KrakenD JSON configuration file included in the FireTail KrakenD plugin’s GitHub repository showcases several key configuration options:
openapi-spec-path
This property specifies the absolute filepath to the OpenAPI schema on the filesystem that the FireTail KrakenD plugin should use to validate API requests and responses.
enable-request-validation
and enable-response-validation
These boolean properties determine whether the FireTail KrakenD plugin should validate API requests or responses against the OpenAPI schema. By default, both are set to false
. You must explicitly enable them to validate your API requests and/or responses:
debug-errs
This boolean property, which defaults to false
, controls whether the FireTail KrakenD plugin includes a details
property in responses that failed to validate against your OpenAPI specification. This is useful for debugging validation errors:
Important: The debug-errs
option should only be set to true
in a development environment. Enabling this option in production can expose sensitive information in error messages, potentially aiding attackers in extracting information from your API.
logs-api-token
This property is used to provide the FireTail API token, which the FireTail KrakenD plugin uses when sending logs to the FireTail SaaS platform.
To get the Firetail KrakenD plugin to send logs to the Firetail platform, you need to create an API token to authenticate with the Firetail platforms logging API.
When you have an API token, add it to your KrakenD configuration file as logs-api-token under the plugin's configuration, as in the example above.
For information on other available configurations, refer to the FireTail KrakenD plugin’s GitHub repository.