Client libraries

Apitally integrates directly with your application through one of our open-source client libraries, which is a small dependency to add to your project.

The diagram below illustrates how the client libraries works.

Diagram showing how the Apitally client library works

The client libraries include the following features:

  • Introspection of your application to capture metadata about endpoints.
  • Lightweight middleware for each supported framework, which captures request and response metadata.
  • A non-blocking client that handles communication with the Apitally Hub.

The clients are designed to be resilient to temporary network failures when communicating with the Apitally Hub and will retry sending data for up to 1 hour.

On startup

When your application starts running and the Apitally middleware is initialized, it introspects your application to capture metadata about all available endpoints. This metadata is then sent to the Apitally Hub in a once-off request.

During runtime

When your application receives a request, the middleware times the invokation of the request handler and captures metadata about the request and response, such as the HTTP method, path and the HTTP status code. If the response is a validation error (status 400 or 422), the middleware inspects the response body for further details about the error.

The captured metadata is then passed to the client which immediately aggregates it with previously received data. The client synchronizes the aggregated data with the Apitally Hub in one minute intervals.

The communication with the Apitally Hub happens either asynchronously or in a separate thread, depending on your framework, which means that it doesn’t interfere with your applications’ handling of requests.

Server side

When the Apitally Hub receives data from your application, it puts it in a queue for asynchronous processing. The data should be processed and visible on the dashboard within a few seconds.

Data is retained for up to 12 months and deleted after that.