Skip to content

Conversation

@hellopatrick
Copy link

@hellopatrick hellopatrick commented Oct 7, 2022

#597 adds support for AWS OpenSearch instances, but the credentials may expire if using the EC2 metadata endpoint (IMDS) to fetch credentials for signing.

As such, before sending request, we should check if the credentials have expired and refresh if need be.

Signed-off-by: Patrick Rogers <[email protected]>
Signed-off-by: Patrick Rogers <[email protected]>
@hellopatrick
Copy link
Author

I believe this also fixes #624, which I'm experiencing as well. After a certain amount of time, the temporary credentials fetched from IMDS expire and just get 403s afterwards.

@hellopatrick
Copy link
Author

Hi, @sysadmind, would it be possible get a look/review? Thanks!

sysadmind added a commit to sysadmind/elasticsearch_exporter that referenced this pull request Oct 17, 2022
Use the AWS cached credential provider to automatically handle credentials. The CredentialsCache will automatically handle refreshing expired credentials and keeping them cached as long as necessary.

Replaces prometheus-community#634 as this offloads more of the work to the AWS SDK

Signed-off-by: Joe Adams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant