how to access cloudwatch logs cross account continously

Current Situation I am in process to create monitoring system for my AWS account with prometheus and grafana. it is able to display results from same AWS account.

Problem Statement I want to pull cloudwatch metrics from other AWS account to centralized logging system.

Things i tried As per my understanding we can use IAM cross account feature to access data present in other AWS account. i found some AWS documentation online but it is mainly for non programmetic user.

[https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html] and [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html]

this require user to login to AWS web console and switch role manually. again tokan available is only for one hour by default

does AWS provide some way to fetch data continously for programmetic user.