-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🪟🔧 AppMonitoringService for custom datadog RUM events #19287
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
area/platform
issues related to the platform
area/frontend
Related to the Airbyte webapp
labels
Nov 10, 2022
josephkmh
changed the title
🪟🔧 [DRAFT] AppMonitoringService for custom RUM events
🪟🔧 [DRAFT] AppMonitoringService for custom datadog RUM events
Nov 10, 2022
josephkmh
commented
Nov 11, 2022
airbyte-webapp/src/hooks/services/AppMonitoringService/AppMonitoringService.tsx
Outdated
Show resolved
Hide resolved
josephkmh
commented
Nov 11, 2022
airbyte-webapp/src/hooks/services/AppMonitoringService/actionCodes.ts
Outdated
Show resolved
Hide resolved
josephkmh
changed the title
🪟🔧 [DRAFT] AppMonitoringService for custom datadog RUM events
🪟🔧 AppMonitoringService for custom datadog RUM events
Nov 11, 2022
timroes
reviewed
Nov 11, 2022
airbyte-webapp/src/packages/cloud/services/thirdParty/launchdarkly/LDExperimentService.tsx
Outdated
Show resolved
Hide resolved
timroes
reviewed
Nov 11, 2022
airbyte-webapp/src/hooks/services/AppMonitoringService/AppMonitoringService.tsx
Outdated
Show resolved
Hide resolved
…toringService.tsx Co-authored-by: Tim Roes <[email protected]>
timroes
approved these changes
Nov 11, 2022
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.
Code LGTM. Have not tested locally.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Adds a monitoring service and hook that allows us to track custom RUM events from the frontend. This is useful for logging when certain code paths are hit, like edge cases or unexpected application states. By logging these events in datadog, we are able to query them and set up monitoring/alerts if thresholds are exceeded.
How
Adds an
ApplicationMonitoringService
that exposes two methods:trackAction: (actionCode: AppActionCodes, context?: Record<string, unknown>) => void;
Sends a RUM event of type
action
to datadogtrackError: (error: Error, context?: Record<string, unknown>) => void;
Sends a RUM event of type
error
to datadogBoth
trackAction
andtrackError
can be called with an optional second parameter,context
, which is a JSON blob of any other relevant data to log.In case the datadog RUM SDK is not initialized,
trackAction
andtrackError
will log messages in the browser console viaconsole.debug
.Recommended reading order
AppMonitoringService.tsx
for the implementationLDExperimentService.tsx
for an example usage: logging when LaunchDarkly takes too long to respond, and fall back to rendering the app without any Launch Darkly feature/experiment flags.