The FireTail APISIX plugin integrates with the FireTail SaaS platform to log and validate API requests and responses.
The FireTail APISIX plugin works as an external plugin using the open-source APISIX Go plugin runner, available in the Apache GitHub organization.
Out of the box, it:
Clone the GitHub Repository
Clone the FireTail APISIX GitHub repository:
After cloning the repository, change directory into the cloned repository:
Compiling
To use the APISIX plugin, you first need to compile it. A makefile can be found in the FireTail APISIX plugin’s GitHub repository. which performs the build process. Use this makefile to compile the APISIX plugin.
make build
.make build
should yield a binary called go-runner
, which is the FireTail APISIX plugin.1. In the root directory, run the Unix socket with the following command:
2. Add the following configuration to the config.yaml
file in APISIX:
3. Restart APISIX with the command apisix restart
.
After building the FireTail APISIX plugin, update your APISIX instance’s config.yaml
file to load the plugin.
1. Add the ext-plugin
property to your config.yaml
file with a cmd
property containing a list. The first element of this list should be the absolute file path to the FireTail APISIX plugin binary on your APISIX instance’s filesystem. The second element should be the command run
, which is passed to the APISIX Go runner.
2. Restart APISIX with apisix restart
.
This should result in an entry in the APISIX logs similar to the text below, stating that the FireTail plugin was registered:
When the FireTail plugin is successfully registered with your APISIX instance, set it up on routes using the ext-plugin-pre-req
and ext-plugin-post-resp
options.
Note: You will need to run your application at localhost (127.0.0.1) port 1980. If you wish to point it elsewhere, change the "nodes" parameter from example below.
The FireTail APISIX plugin can be configured by setting various environment variables. Here are the key environment variables you need to set:
FIRETAIL_URL
This variable defines the endpoint to which the FireTail APISIX plugin should send logs. By default, it uses the log ingest endpoint for the EU region of the FireTail SaaS platform. If you are using a different region, configure this variable accordingly.
OpenAPI Specification
FIRETAIL_API_KEY
This variable provides the API key used when sending log data to the FireTail platform. You can generate an API token on an API page in the FireTail platform. Learn how to generate an API token.
Besides setting the environment variables, you also need to place an OpenAPI specification on the filesystem of the APISIX instance. The FireTail APISIX plugin uses this specification to validate requests and responses. Note: Your OpenAPI specification must be in YAML format.
Go to FireTail's APISIX GitHub repository to learn more.