Skip to content

Commit

Permalink
[Feature Flags] Set RUM transaction.outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Nov 18, 2024
1 parent b6c5423 commit 29c4fde
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,21 @@ export class FeatureFlagsService {
const transaction = apm.startTransaction('set-provider', 'feature-flags');
this.isProviderReadyPromise = OpenFeature.setProviderAndWait(provider);
this.isProviderReadyPromise
.then(() => transaction?.end())
.then(() => {
if (transaction) {
// @ts-expect-error RUM types are not correct
transaction.outcome = 'success';
transaction.end();
}
})
.catch((err) => {
this.logger.error(err);
apm.captureError(err);
transaction?.end();
if (transaction) {
// @ts-expect-error RUM types are not correct
transaction.outcome = 'failure';
transaction.end();
}
});
},
appendContext: (contextToAppend) => this.appendContext(contextToAppend),
Expand Down

0 comments on commit 29c4fde

Please sign in to comment.