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.

[] and []

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.