tencent cloud

Tencent Cloud Observability Platform

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Basic Features
Basic Concepts
Use Cases
Use Limits
Purchase Guide
Tencent Cloud Product Monitoring
Application Performance Management
Mobile App Performance Monitoring
Real User Monitoring
Cloud Automated Testing
Prometheus Monitoring
Grafana
EventBridge
PTS
Quick Start
Monitoring Overview
Instance Group
Tencent Cloud Product Monitoring
Application Performance Management
Real User Monitoring
Cloud Automated Testing
Performance Testing Service
Prometheus Getting Started
Grafana
Dashboard Creation
EventBridge
Alarm Service
Cloud Product Monitoring
Tencent Cloud Service Metrics
Operation Guide
CVM Agents
Cloud Product Monitoring Integration with Grafana
Troubleshooting
Practical Tutorial
Application Performance Management
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Parameter Information
FAQs
Mobile App Performance Monitoring
Overview
Operation Guide
Access Guide
Practical Tutorial
Tencent Cloud Real User Monitoring
Product Introduction
Operation Guide
Connection Guide
FAQs
Cloud Automated Testing
Product Introduction
Operation Guide
FAQs
Performance Testing Service
Overview
Operation Guide
Practice Tutorial
JavaScript API List
FAQs
Prometheus Monitoring
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Terraform
FAQs
Grafana
Product Introduction
Operation Guide
Guide on Grafana Common Features
FAQs
Dashboard
Overview
Operation Guide
Alarm Management
Console Operation Guide
Troubleshooting
FAQs
EventBridge
Product Introduction
Operation Guide
Practical Tutorial
FAQs
Report Management
FAQs
General
Alarm Service
Concepts
Monitoring Charts
CVM Agents
Dynamic Alarm Threshold
CM Connection to Grafana
Documentation Guide
Related Agreements
Application Performance Management Service Level Agreement
APM Privacy Policy
APM Data Processing And Security Agreement
RUM Service Level Agreement
Mobile Performance Monitoring Service Level Agreement
Cloud Automated Testing Service Level Agreement
Prometheus Service Level Agreement
TCMG Service Level Agreements
PTS Service Level Agreement
PTS Use Limits
Cloud Monitor Service Level Agreement
API Documentation
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
Glossary

Installation and Initialization

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-11-01 19:44:02
You can install the SDK through CDN or npm.

Installing and Initializing SDK Through CDN

1. Import the following code to the <head></head> tags on the HTML page:
<script src="https://cdn-go.cn/aegis/aegis-sdk/latest/aegis.min.js"></script>
As CDN uses the h3-Q050 protocol, cache-control is set to max-age=666 by default. If you need to modify cache-control, add the max_age parameter. For example:
<script src="https://cdn-go.cn/aegis/aegis-sdk/latest/aegis.min.js?max_age=3600"></script>
2. Create an Aegis instance and pass in the corresponding configuration in the following steps to initialize the SDK:
const aegis = new Aegis({
id: 'pGUVFTCZyewhxxxxxx', // Application ID, that is, reported ID
uin: 'xxx', // User UIN (optional)
reportApiSpeed: true, // API speed test
reportAssetSpeed: true, // Static resource speed test
spa: true // Enable PV calculation during SPA application page redirect
});

Installing and Initializing SDK Through npm

1. Run the following command to install aegis-web-sdk in your npm repository:
$ npm install --save aegis-web-sdk
2. Create an Aegis instance and pass in the corresponding configuration in the following steps to initialize the SDK:
import Aegis from 'aegis-web-sdk';

const aegis = new Aegis({
id: 'pGUVFTCZyewhxxxxxx', // Application ID, that is, reported ID
uin: 'xxx', // User UIN (optional)
reportApiSpeed: true, // API speed test
reportAssetSpeed: true, // Static resource speed test
spa: true // Enable PV calculation during SPA application page redirect
})
Note:
To avoid missing any data, you should initialize the SDK as early as possible. After you install and initialize the SDK, you can use the following RUM features:
Error monitoring: Monitoring of JavaScript execution errors, Promise errors, Ajax request exceptions, resource loading failures, and return code exceptions, PV reporting, and allowlist detection.
Speed test features: Speed tests for page performance, APIs, and static resources.
Statistics collection and analysis: You can analyze data in multiple dimensions in Data Overview.
Note:
aegis-sdk uses https://aegis.qq.com as the domain name to be reported by default. You can use the hostUrl parameter to configure the domain name to be reported. For regions in the Chinese mainland, you can choose https://tamaegis.com as the domain name to be reported. For Singapore region, you can choose https://rumt-sg.com as the domain name to be reported.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan