Skip to main content
All CollectionsAPI models
My API model is mostly health checks and infrastructure endpoints.
My API model is mostly health checks and infrastructure endpoints.

I was able to successfully generate an API model, but most of what I'm seeing is health checks.

Mark Gritter avatar
Written by Mark Gritter
Updated over 2 years ago

Load balancers and orchestration systems often use a health endpoint to verify whether a service is live. Similarly, there are Kubernetes or AWS endpoints your system may call as part of its regular functioning.

Because these endpoints get called regularly, whether or not there is other traffic, the health endpoints could clog up your API model.

Because Akita samples your traffic, meaning it doesn't send all of your traffic to the Akita Cloud, health check and infrastructure endpoints could come to dominate the traffic that Akita sees. Akita’s rate limiting (which defaults to 1000 calls per minute) may cause some API calls to be dropped— so filtering out the health endpoints ensures that this budget is used entirely for important endpoints.

If this is the case, the solution is to set up filters on the Akita agent. This will increase Akita’s ability to capture meaningful (non-health check) data.

Filtering out endpoints by path

One way to filter out traffic is using the --path-exclusions flag.

To remove a health check endpoint, for instance, use the “--path-exclusions” command line parameter to “apidump”, specifying the path portion of the health check. For example,

apidump –project <your project> –path-exclusions ^/health$

will cause all the “/health” endpoints on all hosts to be ignored by the Akita agent.

The argument to –path-exclusions is a Go regular expression, which may match anywhere within the path. The special characters ^ and $ signal “start of string” and “end of string”; this prevents the filter from matching other paths that include the string “/health”, like “/employee/health-benefits”.

Filtering out endpoints by IP address

A similar problem can arise when your model is littered with API calls to unnamed infrastructure services accessed by IP address. To remove these from your model, you can use a regular expression in the “–host-exclusions” command line parameter, as follows:

apidump –project <your project> –host-exclusions ^(\d)+\.(\d)+\.(\d)+\.(\d)+$

This removes all endpoints whose host is given by a dotted-quad IP address.

Did this answer your question?