Statistics Collection service
Statistics Collection service enables analyzing API key usage and displaying summary data in the Platform Manager. It is optional for the API Platform and can be skipped if statistics collection is not required.
The service consists of two components:
- Stat Receiver: receives data about API key usage when accessing map, search, and navigation services and sends it to Apache Kafka.
- Stat API: reads long-term data from ClickHouse and provides it for display on the Statistics tab in the Platform Manager. If you do not plan to use this tab, installing Stat API is not required.
API Keys service uses data from these components to calculate limit consumption and display request distribution in the Platform Manager.
Architecture
Map services (Tiles API), search services (Catalog APIs), and navigation services (Navi-Back) send API key request data to the Stat Receiver service via HTTP API. After that:
-
Stat Receiver processes the received data and writes it to Apache Kafka.
-
Data from Apache Kafka migrates to the ClickHouse database for storage.
-
Stat API reads data from ClickHouse to provide aggregated metrics to the API Keys service.
-
The API Keys service:
-
retrieves long-term statistics on request counts from Stat API, which are displayed on the Statistics tab in the Platform Manager
-
updates key usage counters in Redis storage to monitor limit consumption for keys and take action on keys that exceed limits
Important
The statistics on limit consumption are updated with a delay (about a minute) after a request to the services using the API key.
-
Dependencies
- For the Statistics Collection service: Apache Kafka storage for events related to API keys
- For the Stat API component:
- Stat Receiver
- ClickHouse storage for long-term statistics on keys usage
For more information on how to check requirements for each service, refer to the System requirements document.
What’s next?
-
Find out how to install or update the service:
-
Read more about On-Premise: