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

Require telemetry for API calls #441

Merged
merged 1 commit into from
Apr 26, 2018
Merged

Require telemetry for API calls #441

merged 1 commit into from
Apr 26, 2018

Conversation

joshcanhelp
Copy link
Contributor

Changing API header calls to include telemetry always. Also adding server and mysql information.

@joshcanhelp joshcanhelp added this to the v3-Next milestone Apr 20, 2018
$header_value = array(
'name' => 'wp-auth0',
'version' => WPA0_VERSION,
'environment' => array(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we support a non-plain object (this environment dictionary). Looking at the previous implementation it seems we do, but may be worth checking if this is easy to query later on the BI app.

Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

I've already left you an un-replied comment here https://github.com/auth0/wp-auth0/pull/441/files#r183123221

Anyway, after reviewing the other PRs and seeing how you're using this method I don't like it. Here you return a new array with a key named "Auth0-Client" and the encoded telemetry. The thing is that later, you call this method and access the header by manually typing it's name.

Instead of using it that way, either:

  • make this method return the raw telemetry data (and probably rename "get_info_headers" to "generate telemetry") OR
  • make this method receive an array or a "request being prepared", and make it be assigned the header inside

An alternative I don't like much for this already implemented scenario is to provide a constant so other methods use that instead of typing the hardcoded name every time they need to access the telemetry header value.

@joshcanhelp
Copy link
Contributor Author

@lbalmaceda - Understood and I agree with everything you said. This PR, though, is only to require this data to be sent, not to refactor the entire telemetry system before we know more about it (I have a request in to the data team now).

@lbalmaceda
Copy link
Contributor

I understand that this PR won't refactor that. However, note that I'm not talking about the contents of the telemetry. I'm pointing out how the method is working today and how it should be changed later. Keeping the method like it is today would require too many wrap-unwrap like operations to just obtain a value. I'll approve this PR, but please track this issue somewhere (new gh issue?).

@joshcanhelp
Copy link
Contributor Author

@lbalmaceda - Understood. This will be addressed once we understand how the telemetry is received and what more we want to (and can) add to it. Good call on tracking, I'll add that as a story.

@joshcanhelp joshcanhelp merged commit a998d73 into dev Apr 26, 2018
@joshcanhelp joshcanhelp deleted the change-telemetry branch April 26, 2018 16:16
@joshcanhelp joshcanhelp mentioned this pull request Jun 5, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants