-
Notifications
You must be signed in to change notification settings - Fork 3
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
content grouping RUM routes in DD #698
Comments
Hm, yeah... so there's currently no way for MFEs like Because (most) logic within // MFE-specific `env.{stage|prod}.config.js` file in {edx|edge}-internal
class CustomDatadogLoggingService extends DatadogLoggingService {
constructor(options) {
super(options);
}
beforeSend(event, context) {
// perform any common/shared logic for `beforeSend` defined within DatadogLoggingService.
const baseBeforeSendResult = super.beforeSend(event, context);
if (!baseBeforeSendResult) {
// base `beforeSend` logic denotes the event should be discarded; no need to do addtl MFE-specific checks
return false;
}
// custom MFE-specific logic...
if ('<event.view.url matches username pattern>') {
event.view.name = '<event.view.url with the username replaced by ?>';
}
return true;
}
}
const config = {
loggingService: CustomDatadogLoggingService,
};
export default config; // DatadogLoggingService (@edx/frontend-logging)
class DatadogLoggingService extends NewRelicLoggingService {
constructor(options) {
super(options);
this.initialize();
}
beforeSend(event, context) {
// common/shared logic across all MFEs
return true;
}
initialize() {
datadogRum.init({
applicationId: process.env.DATADOG_APPLICATION_ID,
clientToken: process.env.DATADOG_CLIENT_TOKEN,
// ...
beforeSend: this.beforeSend,
});
}
} Alternatively, we could also consider exposing a view URL -> view name overrides mapping option that a default [aside] fwiw, slightly related, we might also want to refactor to rely on |
Aperture is going to take on this work, and @adamstankiewicz, we can coordinate with you as needed. (ref ticket https://2u-internal.atlassian.net/browse/APER-3534). |
Problem
Datadog's content grouping of RUM routes is based on the presence of any digits in the view name, which does identify course runs but doesn't usefully identify usernames. This results in RUM views that should be getting pattern grouped and grouped but aren't. So, for example,
profile.edx.org/u/colin_bridgerton
andprofile.edx.org/u/penelope_featherington
will be considered unique pages).Details
The existing DD docs on view name calculation are unclear:
However, on DD support ticket #1748310, DD clarified that by "alphanumeric" they mean "strings that contain at least one digit not preceded by a
v
":Workarounds
On the DD support ticket, they suggest the following:
Question
We should probably standardize this in some way; I don't think we want every MFE owner hardcoding this JS if we can avoid doing that. Is there something we can do in DatadogLoggingService so that, in
[env]_config.yml
orenv.[env].config.js
, an MFE owner could write some mappings forbeforeSend
without manually creating JS?The text was updated successfully, but these errors were encountered: