Skip to content

Commit

Permalink
Merge pull request #44 from edx/hunia/feature-flag-evaluation
Browse files Browse the repository at this point in the history
chore: added feature flag evaluation block
  • Loading branch information
huniafatima-99 authored Feb 3, 2025
2 parents 050a26c + cc78137 commit aff0c08
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/DatadogLoggingService.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ class DatadogLoggingService extends NewRelicLoggingService {
enablePrivacyForActionName: process.env.DATADOG_ENABLE_PRIVACY_FOR_ACTION_NAME || true,
allowedTracingUrls: this.getAllowedTracingUrls(),
});

try {
const featureFlagsToEvaluate = JSON.parse(process.env.FEATURE_FLAGS);
Object.entries(featureFlagsToEvaluate).forEach(([key, value]) => {
datadogRum.addFeatureFlagEvaluation(key, value);
});
} catch (error) {
sendError(`Failed to send feature flags data for evaluation due to this error: ${error}`, {});
}

datadogLogs.init({
...commonInitOptions,
forwardErrorsToLogs: true,
Expand Down

0 comments on commit aff0c08

Please sign in to comment.