-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using google sdk to discover the project ID if it was not provided #62
Using google sdk to discover the project ID if it was not provided #62
Conversation
Please rebase this against master now that we've merged go modules support in. |
ce4d76f
to
7d36c1c
Compare
Done @SuperQ ! |
Hi @SuperQ ! Is there interest on getting this merged? If yes, happy to rebase again |
Yes, sorry for the moving target on master, please rebase. |
7b7d556
to
494d9ee
Compare
Despite I adapted some aspects to the new shape (logger, handlers..), I may need to revisit some things |
…covery, we want that to be defined at boottime, blocking the startup if needed, rather than doing it on each collector creation / handler. Simple project-id discovery logic using the gcloud sdk Signed-off-by: Daniel Caballero <dcaballero@fastly.com>
494d9ee
to
b8e448f
Compare
Signed-off-by: Daniel Caballero <dcaballero@fastly.com>
@SuperQ , new try / rebased and adapted to your new code. I had to rollback one flag definition you moved to the collector, as the projectID is something that, with this addition, becomes dynamic (we dont want to execute the projectID discovery logic on each collector creation / handler logic), and we want to check it during the initial program bootstrap. Feel free to share feedback or request changes. Best! |
Signed-off-by: Daniel Caballero <dcaballero@fastly.com>
Yup, that flag move makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks!
Hei! When can we expect a release for this feature? |
* [FEATURE] Autodiscover Google Poject ID #62 Signed-off-by: Ben Kochie <superq@gmail.com>
* [FEATURE] Autodiscover Google Poject ID #62 Signed-off-by: Ben Kochie <superq@gmail.com>
Hi @frodenas !
thanks so much for developing this exporter! Potential minor contribution:
rather than requiring a explicit project ID, if the exporter is running in GCloud, we can use google SDK to identify the current project.
That makes the
google.project-id
flag no longer required (but we will error and exit if we are unable to identify it successfully).We also identified an unnecessary check in the main (for another argument - you are already marking it as required in the flags package you are using)
Creating also a go module for dependency management so, with go 1.11 or newer, dependencies are automatically fetched.
Best!