-
Notifications
You must be signed in to change notification settings - Fork 1
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: upload source maps to Datadog during MFE deploy #3
Conversation
3e2f22e
to
b407224
Compare
tubular/scripts/frontend_utils.py
Outdated
def _upload_js_sourcemaps(self, app_path): | ||
""" Upload JavaScript sourcemaps to Datadog. """ | ||
app_config = self.get_app_config() | ||
api_key = app_config.get('DATADOG_API_KEY') |
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.
[inform/context]
# Can't upload source maps without ``DATADOG_API_KEY``, which must be set as an environment variable
# before executing the Datadog CLI. The Datadog documentation suggests using a dedicated Datadog API key:
# https://docs.datadoghq.com/real_user_monitoring/guide/upload-javascript-source-maps/
It looks like DATADOG_API_KEY
exists in edx-internal as an ansible secret (e.g., here), but I'm not too sure whether this is accessible by the frontend configs used in frontend_utils.py
.
As is, I'm attempting to extract DATADOG_API_KEY
from the MFE APP_CONFIG
. Assumes DATADOG_API_KEY
is defined under the common frontend config (e.g., here, shared across all MFEs.
@click.option( | ||
'--common-config-file', | ||
help='File from which common configuration variables are read.', | ||
) |
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.
5ed5733
to
22b38e4
Compare
22b38e4
to
eb9e6ed
Compare
Related PR: https://github.com/edx/edx-internal/pull/10993
https://docs.datadoghq.com/real_user_monitoring/guide/upload-javascript-source-maps/
Without source maps uploaded to Datadog for MFEs, any reported JS errors are largely not actionable as engineers cannot discern which specific area of code caused the exception due to minified production JS code.
Example from Datadog docs:
Without source maps
JS error without any clues to to which code area/path triggered the error:
With source maps
Human-readable unminified source code of the exact line of JS code that triggered the error, including a direct link to source code on GitHub: