AIOps

AIOps

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#ITAutomation
#AIOps
#CloudPakforAIOps
#AIOps

 View Only

CP4AIOps - v4.11: Optimizing Rate Limits in Instana Connector Integrations

By Shyam Krishna S S posted 2 days ago

  

The Instana Connector enables seamless integration between an Instana instance and AIOps, allowing for the collection and processing of both metric and event data. In this article, we will focus on the metric collection aspect and the improvements introduced in Release 4.11.0 and 4.11.1.

The connector interacts with Instana APIs to retrieve metric data for selected technologies. However, since Instana enforces API rate limits for each token, exceeding those limits could previously lead to errors and delays in metric collection until the quota reset.

Release 4.11.0 and 4.11.1 introduces significant enhancements designed to make metric ingestion more flexible, efficient, and scalable.

  • Release 4.11.0 - Dynamic Rate Limit Throttling
  • Release 4.11.1 - Option to add multiple API tokens

Dynamic Rate Limit Throttling

The dynamic rate limiter continuously monitors API rate limits after each call and adjusts the request throttling strategy based on the remaining quota and reset time. his throttling approach is specifically applied to APIs responsible for fetching infrastructure metrics, ensuring smooth and uninterrupted data collection without overwhelming the API endpoints.

How It Works

  • The rate limiter continuously monitors API quotas after each call.
  • Based on the remaining quota and reset time, it adjusts the request throttling strategy dynamically.
  • If quota is high, requests proceed at normal speed.
  • If quota is running low, requests are spread out evenly to avoid hitting the ceiling.
  • If quota is nearly exhausted, aggressive throttling ensures uninterrupted data collection until reset.
Dynamic rate limit flow

Rate Limit Handling with Multiple API Tokens

Starting with Release 4.11.1, the Instana connector integration brings a valuable enhancement: support for multiple API tokens during setup. When working with Instana APIs that enforce rate limits for API tokens, the token manager algorithm in the Instana connector offers a robust solution to this challenge by intelligently rotating the tokens to ensure uninterrupted access while staying within the API's usage boundaries.
Instana integration
The token manager continuously monitors API usage statistics for each token. When a token nears its rate limit, the algorithm initiates a rotation process to switch to another token, if available that can continue making requests. By distributing requests across multiple tokens, it effectively mitigates the risk of hitting rate limits—making your integration more resilient and reliable.
TokenManager

How It Works

When the rate limit for a token is reached, the token manager initiates a search for a viable token using the following strategy:

    • Sequential Check: It iterates through the list of tokens.
    • Availability Check: If a token has sufficient remaining calls, it switches to that token immediately.
    • Fallback Strategy: If all tokens are rate-limited, it selects the one with the earliest reset time, minimizing downtime.

This approach ensures:

  • Efficient utilization of all tokens.
  • Compliance with rate limits without manual intervention.

Conclusion

Dynamic rate limit throttling and multiple token rotation helps in maintaining reliable and efficient API interactions from the connector. By adapting request patterns based on quota availability and leveraging multiple tokens smartly, these mechanisms ensure:

  • Continuous data collection without interruptions.
  • Optimal use of available resources while respecting API constraints.
  • Scalability and resilience in environments with fluctuating demand.
0 comments
18 views

Permalink