near / near-indexer-events

7 stars 1 forks source link

expose prometheus metrics + cloudrun compatible #24

Closed roshaans closed 1 year ago

roshaans commented 1 year ago

This PR enables us to look into the performance of the micro-indexers and makes them compatible with GCP's Cloud Run service.

roshaans commented 1 year ago

Could you please re-check the messages that we already have in the PR? E.g., this one is ignored https://github.com/near/near-indexer-events/pull/24/files#r1031328820 After you fix the issue, please mark the message as resolved. If you doubt in the proposed solution, leave the thread unresolved and ask any questions/leave the comments in the same thread

Also, please have a look at khorolets/near-indexer-for-explorer#14 , it's better to use the same approach

Thank you @telezhnaya! I'll keep this in mind for future PRs. Unfortunately, I do not think we can use the same approach as in this PR. The Default provider searches in .aws/credentials for credential details, while we need to be able to pass in these details as environment variables so we can configure it from Cloud Run for example.

I pushed another update to this PR which hides setting up configuration details from the main.rs file. You can view that change here -> https://github.com/near/near-indexer-events/pull/24/files#r1035819281

Update: Yes we can use this approach. We just need to make sure the env variables comply with what the AWS credentials provider expects. "The default credentials provider will also source from the environment, but it looks for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, the sourcing process is described here https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credentials.html." - Morgan

telezhnaya commented 1 year ago

In this case, we have to revert https://github.com/khorolets/near-indexer-for-explorer/pull/14 as well, right? We will have the same deploy process anyway cc @morgsmccauley

roshaans commented 1 year ago

In this case, we have to revert khorolets/near-indexer-for-explorer#14 as well, right? We will have the same deploy process anyway cc @morgsmccauley

Yes, that is correct

morgsmccauley commented 1 year ago

The Default provider searches in .aws/credentials for credential details, while we need to be able to pass in these details as environment variables

@telezhnaya @roshaans The default credentials provider will also source from the environment, but note that it looks for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as described here