Skip to content

Commit e15781a

Browse files
authored
fix(develop): Fix new Span API example (#15412)
Minor fixes for example of new Span API: - wrong span being ended - removed setting error message as attribute
1 parent 59432b8 commit e15781a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

develop-docs/sdk/telemetry/spans/span-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const checkoutSpan = Sentry.startSpan({ name: 'on-checkout-click', attributes: {
120120
const validationSpan = Sentry.startSpan({ name: 'validate-shopping-cart'})
121121
startFormValidation().then((result) => {
122122
validationSpan.setAttribute('valid-form-data', result.success);
123-
processSpan.end();
123+
validationSpan.end();
124124
})
125125

126126
const processSpan = Sentry.startSpan({ name: 'process-order', parentSpan: checkoutSpan});
@@ -129,7 +129,7 @@ processOrder().then((result) => {
129129
processSpan.end();
130130
}).catch((error) => {
131131
processSpan.setStatus('error');
132-
processSpan.setAttribute('error', error.message);
132+
processSpan.setAttribute('order-processed', 'error');
133133
processSpan.end();
134134
});
135135

0 commit comments

Comments
 (0)