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

Configuration Guide

PDF
Focus Mode
Font Size
Last updated: 2024-11-01 19:59:08

Configuration Description

The configuration items in the configuration file are as detailed below:
Configuration Item
Description
id
It is a required number and is empty by default.
It is the project key assigned by your platform.
uin
It is a recommended string and is the UIN field in the cookie by default.
It is the unique ID of the current user. When a log is reported, it will be used to check whether the user is in the allowlist. Its value can contain only letters, digits, and @=._-, and its regular expression is /^[@=.0-9a-zA-Z_-]{1,60}$/.
reportApiSpeed
It is an optional boolean value and is false by default.
It specifies whether to enable API speed test.
version
It is an optional string and is the SDK version number by default.
It is the version of the currently reported content. If the page uses PWA or an offline package, it can be used to judge the version of the code where the currently reported content is from. Its value can contain up to 60 letters, digits, and .,:_-, and its regular expression is /^[0-9a-zA-Z.,:_-]{1,60}$/.
delay
It is an optional number and is 1000 ms by default.
It is the time period for reducing reporting traffic, within which multiple reports will be merged into one reporting request.
repeat
It is an optional number and is 5 by default.
It is the number of repeated reports. After it is exceeded, the same error will not be reported again.
env
It is an optional enum and is Aegis.environment.production by default.
It is the current environment where the project runs.
spa
It is an optional boolean value and is false by default.
It specifies whether to report the PV during page redirect in the mini program.
offlineLog
It is an optional boolean value and is false by default.
It specifies whether to use offline log.
offlineLogExp
It is an optional number and is 3 by default.
It is the offline log validity period.
url
It is an optional string and is //aegis.qq.com/collect by default.
It is the log reporting address.
You can set it to an empty string to disable log reporting.
pvUrl
It is an optional string and is //aegis.qq.com/collect/pv by default.
It is the PV reporting address.
You can set it to an empty string to disable PV reporting.
whiteListUrl
It is an optional string and is //aegis.qq.com/collect/whitelist by default.
It is the allowlist confirming API.
You can set it to an empty string to disable allowlist API request.
offlineUrl
It is an optional string and is //aegis.qq.com/collect/offline by default.
It is the offline log reporting address.
You can set it to an empty string to disable offline log reporting.
eventUrl
It is an optional string and is //aegis.qq.com/collect/events by default.
It is the custom event reporting address.
You can set it to an empty string to disable custom event reporting.
speedUrl
It is an optional string and is //aegis.qq.com/speed by default.
It is the speed test log reporting address.
You can set it to an empty string to disable speed test data reporting.
customTimeUrl
It is an optional string and is //aegis.qq.com/speed/custom by default.
It is the custom speed test reporting address.
You can set it to an empty string to disable custom speed test reporting.
performanceUrl
It is an optional string and is //aegis.qq.com/speed/performance by default.
It is the page performance reporting address.
You can set it to an empty string to disable page performance reporting.
setDataReportConfig
It is an optional object and is {} by default. Fields:
disabled: it specifies whether to disable setData data reporting. It is an optional boolean value and is false by default.
timeThreshold: it is the reporting duration threshold. It is an optional number and is 30 by default. Only data whose update duration exceeds this threshold will be reported.
withDataPaths: it specifies whether to report the field information updated currently. It is an optional boolean value and is true by default.
api
It is an optional object and is {} by default. Fields:
apiDetail: it specifies whether to report the API request parameters and returned value if an API fails. It is an optional boolean value and is false by default.
retCodeHandler: it is the hook function for return code reporting and will pass in the API response data. The returned value is {isErr: boolean, code: string}. For more information, see api.retCodeHandler.
reportRequest: it is a boolean value and is false by default. After it is enabled, aegis.info will report the full data with no need to configure the allowlist, and information of all APIs will be reported (you need to enable reportApiSpeed in the reporting API).
ext1
It is the additional dimension in custom reporting, which can be overwritten during reporting. It is an optional string.
ext2
It is the additional dimension in custom reporting, which can be overwritten during reporting. It is an optional string.
ext3
It is the additional dimension in custom reporting, which can be overwritten during reporting. It is an optional string.

Sample Code

api.retCodeHandler

If the backend returns the following data:
{
body: {
code: 200,
retCode: 0,
data: {
// xxx
}
}
If your business requires that if the code is not 200 or retCode is not 0, the request is incorrect. To meet this requirement, you can simply configure as follows:
new Aegis({
// xxx
reportApiSpeed: true, // You need to enable two speed test APIs; otherwise, no return code will be reported
reportAssetSpeed: true,
api: {
retCodeHandler(data) {
// Note that the obtained `data` is a string. If you want to get an object, you need to manually parse it
try {
data = JSON.parse(data)
} catch (e) {
}
return {
isErr: data.body.code !== 200 || data.body.retCode !== 0,
code: data.body.code
}
}
}
})


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback