You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(js): Replace Unicode em dashes and arrows with ASCII
Replace em dashes (—) with hyphens (-) and arrows (→) with (->)
These Unicode characters were causing 'atob' encoding errors:
'InvalidCharacterError: Failed to execute atob on Window'
The atob function only supports Latin1 (ISO-8859-1) characters.
All special Unicode characters have been replaced with ASCII equivalents.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/tracing/span-metrics/examples.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Example Repository: [Crash Commerce](https://github.com/getsentry/crash-commerce
22
22
23
23
**Solution:** Start a client span on the checkout action for the application, and relevant spans on the backend for each step in the checkout flow. Attach attributes that represent critical metrics for the application, such as cart size and value, and payment provider used in the transaction.
24
24
25
-
**Frontend (React) — instrument the Checkout click handler:**
25
+
**Frontend (React) - instrument the Checkout click handler:**
26
26
27
27
```javascript
28
28
// In your Checkout button click handler
@@ -77,7 +77,7 @@ Where to put this in your app:
77
77
- In the `onClick` for the checkout button, or inside the submit handler of your checkout form/container component.
78
78
- Auto-instrumentation will add client `fetch` spans; keep the explicit UI span for specific application context.
79
79
80
-
**Backend — Checkout API with an Order Processing span, and a Payment span:**
80
+
**Backend - Checkout API with an Order Processing span, and a Payment span:**
- UI span starts when checkout is selected → Server Backend starts a span to continue the track when the server `/checkout` API is called. As payment processes, a payment span is started.
163
+
- UI span starts when checkout is selected -> Server Backend starts a span to continue the track when the server `/checkout` API is called. As payment processes, a payment span is started.
164
164
- Attributes and Span metrics let you track more than just the latency of the request. Can track store busienss performances through `cart.item_count` and other `cart` attributes, and store reliabiliyt by checking error performance on `payment.provider` properties.
165
165
166
166
What to monitor with span metrics:
@@ -175,7 +175,7 @@ Example Repository: [SnapTrace](https://github.com/getsentry/snaptrace-tracing-e
175
175
176
176
**Solution:** Start a client span for the entire upload experience, create a backend span for upload validation, and a separate span for async media processing. Use rich attributes instead of excessive spans to capture processing details.
177
177
178
-
**Frontend (React) — Instrument Upload Action**
178
+
**Frontend (React) - Instrument Upload Action**
179
179
180
180
```typescript
181
181
// In your UploadForm component's upload handler
@@ -238,7 +238,7 @@ Where to put this in your app:
238
238
- In drag-and-drop onDrop callback
239
239
- Auto-instrumentation will capture fetch spans; the explicit span adds business context
// Async media processing (runs in background via setImmediate)
@@ -412,7 +412,7 @@ Example Repository: [NullFlix](https://github.com/getsentry/nullflix-tracing-exa
412
412
413
413
**Solution:** Start a client span for each debounced request, mark aborted requests, track search patterns, and on the server, instrument search performance with meaningful attributes.
**Frontend (React) — Instrument AI Chat Interface:**
561
+
**Frontend (React) - Instrument AI Chat Interface:**
562
562
563
563
```typescript
564
564
import { useState, useEffect } from'react';
@@ -652,7 +652,7 @@ Where to put this in your app:
652
652
653
653
**Important:** Generate `sessionId` in `useEffect` to avoid hydration errors when using Server-Side Rendering (SSR). Using `Date.now()` or random values during component initialization will cause mismatches between server and client renders.
654
654
655
-
**Backend — Custom LLM Integration with Tool Calls:**
655
+
**Backend - Custom LLM Integration with Tool Calls:**
0 commit comments