Skip to content

Commit bb9db67

Browse files
committed
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.
1 parent f1e3a2e commit bb9db67

File tree

1 file changed

+11
-11
lines changed
  • docs/platforms/javascript/common/tracing/span-metrics

1 file changed

+11
-11
lines changed

docs/platforms/javascript/common/tracing/span-metrics/examples.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Example Repository: [Crash Commerce](https://github.com/getsentry/crash-commerce
2222

2323
**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.
2424

25-
**Frontend (React) instrument the Checkout click handler:**
25+
**Frontend (React) - instrument the Checkout click handler:**
2626

2727
```javascript
2828
// In your Checkout button click handler
@@ -77,7 +77,7 @@ Where to put this in your app:
7777
- In the `onClick` for the checkout button, or inside the submit handler of your checkout form/container component.
7878
- Auto-instrumentation will add client `fetch` spans; keep the explicit UI span for specific application context.
7979

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:**
8181

8282
```javascript
8383
// Example: Node/Express
@@ -160,7 +160,7 @@ app.post('/api/checkout', async (req: Request, res: Response) => {
160160
```
161161
162162
**How the trace works together:**
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.
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.
164164
- 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.
165165
166166
What to monitor with span metrics:
@@ -175,7 +175,7 @@ Example Repository: [SnapTrace](https://github.com/getsentry/snaptrace-tracing-e
175175
176176
**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.
177177
178-
**Frontend (React) Instrument Upload Action**
178+
**Frontend (React) - Instrument Upload Action**
179179
180180
```typescript
181181
// In your UploadForm component's upload handler
@@ -238,7 +238,7 @@ Where to put this in your app:
238238
- In drag-and-drop onDrop callback
239239
- Auto-instrumentation will capture fetch spans; the explicit span adds business context
240240
241-
**Backend Upload Validation and Queue Job**
241+
**Backend - Upload Validation and Queue Job**
242242
243243
<Alert>
244244
@@ -307,7 +307,7 @@ app.post('/api/upload', async (req: Request<{}, {}, UploadRequest>, res: Respons
307307
});
308308
```
309309
310-
**Backend Async Media Processing (Consumer)**
310+
**Backend - Async Media Processing (Consumer)**
311311
312312
```typescript
313313
// Async media processing (runs in background via setImmediate)
@@ -412,7 +412,7 @@ Example Repository: [NullFlix](https://github.com/getsentry/nullflix-tracing-exa
412412
413413
**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.
414414
415-
**Frontend (React + TypeScript) instrument debounced search:**
415+
**Frontend (React + TypeScript) - instrument debounced search:**
416416
417417
```typescript
418418
const response = await Sentry.startSpan(
@@ -467,7 +467,7 @@ const response = await Sentry.startSpan(
467467
Where to put this in your app:
468468
- In your search input component, triggered after debounce timeout
469469
470-
**Backend (Node.js + Express) instrument search with meaningful attributes:**
470+
**Backend (Node.js + Express) - instrument search with meaningful attributes:**
471471
472472
```typescript
473473
app.get('/api/search', async (req: Request, res: Response) => {
@@ -528,7 +528,7 @@ app.get('/api/search', async (req: Request, res: Response) => {
528528
```
529529
530530
**How the trace works together:**
531-
- Client span starts when debounced search triggers tracks the full user-perceived latency.
531+
- Client span starts when debounced search triggers -> tracks the full user-perceived latency.
532532
- Aborted requests are marked with `ui.aborted=true` and short duration, showing wasted work.
533533
- Server span shows search performance characteristics: mode (prefix vs fuzzy), results count, and slow queries.
534534
@@ -558,7 +558,7 @@ This example follows Sentry's AI Agents Module conventions. For detailed specifi
558558
559559
![Custom LLM Monitoring](./img/custom-llm-monitoring.png)
560560
561-
**Frontend (React) Instrument AI Chat Interface:**
561+
**Frontend (React) - Instrument AI Chat Interface:**
562562
563563
```typescript
564564
import { useState, useEffect } from 'react';
@@ -652,7 +652,7 @@ Where to put this in your app:
652652
653653
**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.
654654
655-
**Backend Custom LLM Integration with Tool Calls:**
655+
**Backend - Custom LLM Integration with Tool Calls:**
656656
657657
```typescript
658658
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';

0 commit comments

Comments
 (0)