I am pretty new to the Prometheus and not sure how I am going to ping the endpoint with authentication. Not sure my problem could be solved by built-in prometheus configs, let me describe the flow I would like to achieve:
(1) send http POST with {username, password} to api endpoint company.com/auth
(2) should retrieve {access_tokens, refresh_token...} of Bearer token type
(3) preserve this access_token and direct to other pages. All the other endpoints should only be pinged, if the access_token is already there and correct.
(4)After authentication, it should still send the http request at some frequency and output the metrics just as the blackbox-exporter do.
Basically I am trying to mimic the same procedure for sequence of API calls in Postman tests. I've seen config of blackbox-exporter of basic_auth and bearer_token, but not sure how to actually setup the params and how to redirect to other pages.
(Should I set the basic_auth username and password according to (1)? Where the token is returned? And should I replace the token to bearer_token?)
Any guidance on this would be great! I am pretty new to the whole process, sorry if the question is too fundamental or ambiguous. Thanks in advance and really appreciate any help!