Skip to content
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

Add google_webmaster collector. #1959

Merged
merged 2 commits into from
Nov 16, 2016
Merged

Conversation

alienth
Copy link
Contributor

@alienth alienth commented Nov 15, 2016

No description provided.

func analyticsClient(clientid string, secret string, tokenstr string) (*http.Client, error) {
// googleAPIClient() takes in a clientid, secret, a base64'd gob representing
// the cached oauth token, and a list of oauth scopes. Generating the token is
// left as an exercise to the reader.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because generating the token requires you to fire up an web endpoint, have the user open a URL, and then wait around for the user to authorize. Back when the GA collector was written, we decided that scollector should not be involved in doing that.

@kylebrandt
Copy link
Member

sorry to be more clear, I meant why not document the process?

On Wed, Nov 16, 2016 at 12:36 PM, Jason Harvey notifications@github.com
wrote:

@alienth commented on this pull request.

In cmd/scollector/collectors/google_analytics.go
#1959:

@@ -183,16 +183,17 @@ func getPageviews(md *opentsdb.MultiDataPoint, svc *analytics.Service, site conf
return nil
}

-// analyticsClient() takes in a clientid, secret, and a base64'd gob representing the cached oauth token.
-// Generating the token is left as an exercise to the reader. (TODO)
-func analyticsClient(clientid string, secret string, tokenstr string) (*http.Client, error) {
+// googleAPIClient() takes in a clientid, secret, a base64'd gob representing
+// the cached oauth token, and a list of oauth scopes. Generating the token is
+// left as an exercise to the reader.

Because generating the token requires you to fire up an web endpoint, have
the user open a URL, and then wait around for the user to authorize. Back
when the GA collector was written, we decided that scollector should not be
involved in doing that.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1959, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABnT0AQSSSpVAzbPM9oJ6JjwWcWPNhAyks5q-z8CgaJpZM4KyqOY
.

@alienth
Copy link
Contributor Author

alienth commented Nov 16, 2016

@kylebrandt because I don't remember how to do it. I'm just reusing the token I generated last time.

Could look into how that is done and document how to do it, but that's out of scope for this project.

@kylebrandt
Copy link
Member

Fair enough - code looks good to me

On Wed, Nov 16, 2016 at 12:38 PM, Jason Harvey notifications@github.com
wrote:

@kylebrandt https://github.com/kylebrandt because I don't remember how
to do it. I'm just reusing the token I generated last time.

Could look into how that is done and document how to do it, but that's out
of scope for this project.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1959 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABnT0GxtIptqp9beI1bhUxgATv2NEYp3ks5q-z-LgaJpZM4KyqOY
.

@alienth alienth merged commit 9a6ec01 into bosun-monitor:master Nov 16, 2016
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.

2 participants