- Kong Gateway simplifies API traffic management, security, and scalability, providing a robust framework to handle and route API requests across microservices efficiently.
- Atatus delivers deep API analytics, offering detailed insights into the performance, health, and reliability of APIs and micro services managed by Kong..
Installation Steps for the Atatus Kong Plugin
Ifluarocks is installed (typically included in official installation packages), you can add the package to your LuaRocks tree, where Lua modules are stored.
1. Install the Atatus Plugin
lua-zlib library dependencies (including git, zlib1g-dev, and gcc) are installed. If using apt, you can install them with:
kong.conf, append atatus to the plugins field (or custom_plugins if using an older version of Kong). Ensure the field is not commented out.
YOUR_LICENSE_KEY with your actual Atatus license key:
User and Company Identification in Atatus
Atatus automatically identifies API users to help associate API traffic with web traffic, providing insights into user interactions and customer journeys. To enable user and company tracking, modify the Atatus plugin configuration as follows:YOUR_LICENSE_KEY with your actual Atatus license key. This configuration ensures that Atatus can track users and associate API requests with companies.
Identifying Users
By default, Atatus determines users through various methods: 1. Ifconfig.user_id_header is set, Atatus extracts the value from the specified HTTP header.
2. Otherwise, Atatus looks for user identifiers in the following order:
x-consumer-custom-idx-consumer-usernameX-consumer-id
config.authorization_header_name, Atatus extracts the user ID as follows:
- If the header contains Bearer, it decodes the base64 string and retrieves the value specified by
config.authorization_user_id_field(default:sub). - If the header contains Basic, it decodes the base64 string and extracts the username (before the
:character).
config.user_id_header or override config.authorization_header_name and config.authorization_user_id_field.
Identifying Companies
Atatus can track API usage at an account level by associating API users with companies: 1. Ifconfig.company_id_header is defined, Atatus will use the value from that header.
2. You can also update user details using the Atatus API to assign a company_id to a user, enabling automatic association of API calls with the corresponding company.
3. If an authorization token is present in config.authorization_header_name, Atatus extracts the company ID as follows:
- If the header contains Bearer, it decodes the base64 string and retrieves the value specified by
config.authorization_company_id_field.