Flashduty Docs
中文EnglishRoadmapAPI官网控制台
中文EnglishRoadmapAPI官网控制台
  1. Best Practice
  • Introduction
  • On-call
    • Getting Started
      • Quick start
      • FAQ
      • Product Comparison
    • Incidents
      • What is an Incident
      • View Incidents
      • Handle Incidents
      • Escalations and Assignments
      • Custom Fields
      • Custom Actions
      • Alert Noise Reduction
      • Past Incidents
      • Outlier Incidents
    • Configure On-call
      • Channels
      • Integrate Alerts
      • Alert Noise Reduction
      • Escalation Rules
      • Label Enrichment
      • Schedules
      • Templates
      • Service Calendars
      • Preferences
      • Alert Routing
      • Silence and Inhibition
      • Filters
      • Notifications
      • Alert Pipeline
    • Advanced Features
      • Referencing Variables
      • Dynamic Assignment
      • Insights
      • War-room
    • Integrations
      • Alerts integration
        • Standard Alert Integration
        • Email Integration
        • Nightingale/FlashCat Integration
        • Prometheus Integration
        • Grafana Integration
        • Zabbix Integration
        • Uptime Kuma Integration
        • Alibaba Cloud ARMS Integration
        • Alibaba Cloud Monitor CM Event Integration
        • Alibaba Cloud Monitor CM Metrics Integration
        • Alibaba Cloud SLS Integration
        • AWS CloudWatch Integration
        • Azure Monitor Integration
        • Baidu Cloud BCM Integration
        • Huawei Cloud CES Integration
        • Influxdata Integration
        • Open Falcon Integration
        • PagerDuty Integration
        • Tencent BlueKing Integration
        • Tencent Cloud CLS Integration
        • Tencent Cloud Monitor CM Integration
        • Tencent Cloud EventBridge
        • OceanBase Integration
        • Graylog Integration
        • Skywalking Integration
        • Sentry Integration
        • Jiankongbao Integration
        • AWS EventBridge Integration
        • Dynatrace Integration
        • Huawei Cloud LTS Integration
        • GCP Integration
        • Splunk Alert Events Integration
        • AppDynamics Alert Integration
        • SolarWinds Alert Events Integration
        • Volcengine CM Alert Events Integration
        • Volcengine CM Event Center Integration
        • Volcengine TLS Integration
        • OpManager Integration
        • Meraki Integration
        • Keep Integration
        • ElastAlert2 Alert Integration
        • StateCloud Alert Events
        • Guance Alert Events
        • Zilliz Alert Events
        • Huawei Cloud APM Alerts
        • zstack integration
        • Monit Alert Integration
        • RUM Alert Integration
      • Change integration
        • Standard Change Event
        • Jira Issue Events
      • IM integration
        • Feishu (Lark) Integration Guide
        • Dingtalk Integration
        • WeCom Integration
        • Slack Integration
        • Microsoft Teams Integration
      • Single Sign-On
        • Authing Integration
        • Keycloak Guide
        • OpenLDAP Guide
      • Webhooks
        • Alert webhook
        • Incident webhook
        • Costom action
        • ServiceNow Sync
        • Jira Sync
      • Other
        • Link Integration
  • RUM
    • Getting Started
      • Introduction
      • Quick start
      • FAQ
    • Applications
      • Applications
      • SDK Integration
      • Advanced Configuration
      • Analysis Dashboard
    • Performance Monitoring
      • Overview
      • Metrics
      • Performance Analysis
      • Performance Optimize
    • Error Tracking
      • Overview
      • Error Reporting
      • Issues
      • Source Mapping
      • Error Grouping
      • Issue States
      • Issue Alerting
    • Session Explorer
      • Overview
      • Data Query
    • Session Replay
      • View Session Replay
      • Overview
      • SDK Configuration
      • Privacy Protection
    • Best Practice
      • Distributed Tracing
    • Others
      • Terminology
      • Data Collection
      • Data Security
  • Platform
    • Teams and Members
    • Permissions
    • Single Sign-On
  • Terms
    • Terms of Service
    • User Agreement/Privary Policy
    • SLA
    • Data Security
  1. Best Practice

Distributed Tracing

Overview#

FlashDuty RUM's Trace Tracking feature deeply integrates front-end user monitoring with distributed tracing systems, allowing you to correlate web application requests with their corresponding backend traces. This combination enables you to view complete front-end and backend data at a glance, achieving end-to-end performance monitoring and issue troubleshooting.
Through Trace Tracking, you can:
Correlate front-end and back-end requests: Link front-end user operations with backend API calls
End-to-end issue troubleshooting: Quickly locate issues in the complete request chain from front-end to back-end
Performance bottleneck analysis: Identify performance bottlenecks throughout the entire request chain
User experience optimization: Optimize user experience based on complete request chain data

How It Works#

Trace tracking is implemented based on the W3C Trace Context standard, correlating front-end and back-end requests by injecting trace information into HTTP request headers:
1.
Front-end initiates request: The RUM SDK automatically adds trace header information to configured API requests
2.
Back-end receives and processes: Backend services receive and process requests with trace information
3.
Chain correlation: Front-end and back-end data are correlated through the same trace_id
4.
Visual display: View complete request chain information through trace correlation based on trace_id

Configuration Steps#

1. SDK Configuration#

First, you need to configure the distributed tracing feature in the RUM SDK. Based on the RUM Advanced Configuration Documentation, add the following parameters when initializing the RUM SDK:

Key Configuration Parameters#

allowedTracingUrls: Specifies API endpoints that need trace information added
String: Matches URLs starting with this value, e.g., https://api.example.com
Regular Expression: Uses regex to match URLs
Function: Custom matching logic, returns true for successful matches
traceSampleRate: Trace sampling rate, controls what percentage of requests are traced
Range: 0-100
Default: 100 (trace all requests)
Recommendation: Set to 10-20 in production to balance monitoring coverage and performance

2. Application Management Configuration#

After SDK configuration, you can configure trace jump settings in the application management page:
1.
Go to Application Management page
2.
Select the corresponding RUM application
3.
Configure the trace system jump address (if distributed tracing system is integrated)
4.
Enable Trace Tracking feature in Advanced Configuration
提示
In the configured jump link, the system will automatically replace ${trace_id} with the actual trace_id.
2025-09-28-11-05-53

3. Backend Service Configuration#

For complete distributed tracing support, backend services need to:
1.
Receive trace header information: Process traceparent and tracestate request headers
2.
Pass trace information: Continue passing trace headers when calling other services
3.
Generate trace data: Record request processing into the tracing system

Trace Header Information#

The RUM SDK automatically adds the following HTTP header information to configured requests:

traceparent Header#

traceparent: 00-00000000000000008448eb211c80319c-b7ad6b7169203331-01
Format: [version]-[trace-id]-[parent-id]-[trace-flags]
version: Currently 00
trace-id: 128-bit trace ID, 32 characters after hexadecimal processing
parent-id: 64-bit span ID, 16 characters after hexadecimal processing
trace-flags: Sampling flag, 01 indicates sampled, 00 indicates not sampled

tracestate Header#

tracestate: dd=s:1;o:rum
Format: dd=s:[sampling-priority];o:[origin]
sampling-priority: 1 indicates the trace is sampled
origin: Always rum, indicating collection through RUM SDK

Use Cases#

1. Viewing Traces in RUM Session Explorer#

After configuration, you can view corresponding trace information in the View section of the RUM Session Explorer:
1.
Go to RUM Session Explorer
2.
Select a page view containing API calls
3.
View Trace Information in the view details
4.
Click the trace link to jump to the trace system to view detailed request chains
2025-09-28-11-07-23

2. Finding Resources by trace_id#

You can also search for resources in the explorer using trace_id:
1.
Enter trace_id in the explorer search bar
2.
View corresponding resources and view loading conditions
3.
Analyze the correlation between resource loading performance and backend API calls
2025-09-28-11-10-06
提示
You can also query corresponding resources directly by appending parameters to the URL. Example URL:
https://console.flashcat.cloud/rum/explorer?appid=${YOUR_APP_ID}&end=${END_TIME}&eventType=resource&queryStr=trace_id%3A${TRACE_ID}&start=${START_TIME}
Where start, end, and appid are optional parameters. If not provided, the current RUM default query application and time range will be reused. You can construct the URL according to your actual situation.

3. End-to-End Issue Troubleshooting#

When users report performance issues:
1.
Find the problematic user's session in the RUM Session Explorer
2.
View trace information for the problem page
3.
Jump to the trace system to view the complete request chain
4.
Determine whether it's a front-end, back-end, or network issue

Best Practices#

1. Reasonable Sampling Rate Configuration#

Development Environment: Recommend setting to 100% to ensure all requests are traced
Testing Environment: Recommend setting to 50-80% to balance monitoring coverage and performance
Production Environment: Recommend setting to 10-20% to avoid performance impact

2. Precise Tracing URL Configuration#

3. Cross-Origin Request Handling#

If your HTTP requests involve cross-origin issues, ensure:
Server is configured with correct CORS headers
Preflight requests are supported
traceparent and tracestate headers are allowed

4. Performance Monitoring#

Regularly check the impact of trace sampling rate on application performance
Monitor storage and query performance of trace data
Adjust tracing strategy based on business requirements

Common Issues#

Q: Why don't some requests have trace information?#

A: Possible reasons include:
Request URL is not within the allowedTracingUrls configuration range
Request was filtered by traceSampleRate sampling rate
Request was initiated before SDK initialization
Cross-origin requests lack necessary CORS configuration

Q: How to verify if trace configuration is correct?#

A: You can verify through the following methods:
1.
Check network request headers in browser developer tools
2.
Confirm requests contain traceparent and tracestate headers
3.
Check if trace information is displayed in the RUM Session Explorer

Notes#

1.
Privacy Compliance: Ensure trace data collection complies with relevant privacy regulations
2.
Performance Impact: Set reasonable sampling rates to avoid significant impact on application performance
3.
Data Security: Avoid including sensitive information in trace data
4.
Cross-Origin Configuration: Ensure backend services are properly configured with CORS to support trace headers

Related Documentation#

RUM Advanced Configuration - Learn about complete RUM SDK configuration options
RUM Session Explorer Overview - Master the use of RUM Session Explorer

添加官方技术支持微信

在这里,获得使用上的任何帮助,快速上手FlashDuty

微信扫码交流
修改于 2025-09-28 03:10:31
上一页
Privacy Protection
下一页
Terminology
Built with