Hello @Sameh Tawfik (External - PwC AB (SE))
This issue can be caused by a number of factors, including resource utilization, network latency, and API throttling.
One possible cause of this issue is resource utilization. Even if CPU and memory usage appear to be stable, it's possible that your function is consuming resources in a way that is not immediately apparent.
One way to address this is to monitor resource utilization over time to see if there are any patterns or trends that might indicate a problem. You can also try scaling up your function to see if this improves performance.
Another possible cause of this issue is network latency. If your function is making a large number of requests to external APIs, it's possible that network latency is causing delays in data retrieval.
To address this, you can try optimizing your function's network settings, such as increasing the connection timeout or adjusting the maximum number of concurrent connections.
Finally, API throttling can also cause gradual increases in execution time. If the external APIs you are accessing have rate limits or other throttling mechanisms in place, it's possible that your function is being throttled over time.
To address this, you can try adjusting the rate at which your function makes requests to the API, or implementing a caching mechanism to reduce the number of requests your function needs to make.
In general, it's a good practice to monitor your function's performance over time and make adjustments as needed to maintain consistent performance. This can include scaling up or down as needed, optimizing network settings, and implementing caching or other performance-enhancing mechanisms.
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.