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

feat(tracking): add telemetry for frontend events #6129

Conversation

aditya-radhakrishnan
Copy link
Contributor

@aditya-radhakrishnan aditya-radhakrishnan commented Oct 5, 2022

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Oct 5, 2022
@github-actions
Copy link

github-actions bot commented Oct 5, 2022

Unit Test Results (build & test)

597 tests  +6   593 ✔️ +6   11m 43s ⏱️ -37s
147 suites +1       4 💤 ±0 
147 files   +1       0 ±0 

Results for commit 74e8424. ± Comparison against base commit 485d569.

♻️ This comment has been updated with latest results.

response.getEntity().toString()));
}
} catch (Exception e) {
throw new RuntimeException("Failed to verify credentials for user", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Failed to verify credentials for user is this the right error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it's not, updated!

throw new RuntimeException("Failed to verify credentials for user", e);
} finally {
try {
httpClient.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to open & close this client each time we make a request? theres no re-usable client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored to use one client


@Nonnull
JSONObject sanitizeEvent(@Nonnull final JsonNode event) {
final JSONObject eventObj;
Copy link
Contributor

Choose a reason for hiding this comment

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

for the sake of no confusion, would be good to call this unsanitizedEventObj

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, renamed

try {
bodyJson = mapper.readTree(jsonStr);
} catch (JsonProcessingException e) {
log.error(String.format("Failed to parse json while attempting to create native user %s", jsonStr));
Copy link
Contributor

Choose a reason for hiding this comment

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

is this comment right?

@aditya-radhakrishnan aditya-radhakrishnan merged commit e825978 into datahub-project:master Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants