Add google_webmaster collector. #1959

Merged
merged 2 commits into from Nov 16, 2016

Conversation

Projects
None yet
2 participants
@alienth
Contributor

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.

This comment has been minimized.

@kylebrandt

kylebrandt Nov 16, 2016

Member

Why?

This comment has been minimized.

@alienth

alienth Nov 16, 2016

Contributor

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.

@alienth

alienth Nov 16, 2016

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@kylebrandt

kylebrandt Nov 16, 2016

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
.

Member

kylebrandt commented Nov 16, 2016

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

This comment has been minimized.

Show comment
Hide comment
@alienth

alienth Nov 16, 2016

Contributor

@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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@kylebrandt

kylebrandt Nov 16, 2016

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
.

Member

kylebrandt commented Nov 16, 2016

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

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment