Apache SkyWalkingApache SkyWalking is an application performance monitoring tool (Application Performance Management, APM) for distributed systems, designed for microservices, cloud native architectures, and container-based (Docker, K8s, Mesos) architectures. It provides an all-in-one solution for distributed tracing, service mesh telemetry analysis, metrics aggregation, and visualization. Apache SkyWalking Alerts Apache SkyWalking alarms are driven by a set of rules, which are defined in The definition of alarm rules is divided into three parts.
Alarm rulesThere are two types of alarm rules: individual rules and composite rules. Composite rules are a combination of individual rules. Individual RulesThe individual rules mainly include the following:
The tag settings must store the data in a meter-system, such as Prometheus, Micrometer. The above four label settings must implement the
For multiple value metrics such as percentile, thresholds is an array. Describe it like
For example: rules: service_resp_time_rule: metrics-name: service_resp_time op: ">" threshold: 1000 period: 10 count: 2 silence-period: 10 message: The average response time of service [{name}] exceeded 1 second for 2 minutes in the last 10 minutes service_instance_resp_time_rule: metrics-name: service_instance_resp_time op: ">" threshold: 1000 period: 10 count: 2 silence-period: 10 message: The average response time of instance [{name}] exceeded 1 second for 2 minutes in the last 10 minutes endpoint_resp_time_rule: metrics-name: endpoint_avg threshold: 1000 op: ">" period: 10 count: 2 message: The average response time of endpoint [{name}] exceeded 1 second for 2 minutes in the last 10 minutes. The articles are continuously updated. Search "Wanmao Academy" on WeChat to read them first. After following it, reply "e-book" to get 12 must-read Java technical books for free. Composite Rules Composite rules are only applicable to alarm rules targeting the same entity level, for example, both are service-level alarm rules: The main points of compound rules are as follows:
For example: rules: service_resp_time_rule: metrics-name: service_resp_time op: ">" threshold: 1000 period: 10 count: 2 silence-period: 10 message: The average response time of service [{name}] exceeded 1 second for 2 minutes in the last 10 minutes service_sla_rule: metrics-name: service_sla op: "<" threshold: 8000 period: 10 count: 2 silence-period: 10 message: The success rate of service [{name}] was less than 80% for 2 minutes in the last 10 minutes. composite-rules: comp_rule: expression: service_resp_time_rule && service_sla_rule message: Service [{name}] has an average response time of more than 1 second for 2 minutes in the last 10 minutes and a success rate of less than 80%. Webhooks Webhooks require a peer-to-peer web container. The warning message will be sent via HTTP request. The request method is
For example: [{ "scopeId": 1, "scope": "SERVICE", "name": "one-more-service", "id0": "b3JkZXItY2VudGVyLXNlYXJjaC1hcGk=.1", "id1": "", "ruleName": "service_resp_time_rule", "alarmMessage": "The average response time of service [one-more-service] exceeded 1 second for 2 minutes in the last 10 minutes", "startTime": 1617670815000 }, { "scopeId": 2, "scope": "SERVICE_INSTANCE", "name": "[email protected] of one-more-service", "id0": "dWF0LWxib2Mtc2VydmljZQ==.1_ZTRiMzEyNjJhY2FhNDdlZjkyYTIyYjZhMmI4YTdjYjFAMTcyLjI0LjMwLjEzOA==", "id1": "", "ruleName": "instance_jvm_young_gc_count_rule", "alarmMessage": "The YoungGC times of instance [[email protected] of one-more-service] exceeded 10 times in 2 minutes in the last 10 minutes", "startTime": 1617670815000 }, { "scopeId": 3, "scope": "ENDPOINT", "name": "/one/more/endpoint in one-more-service", "id0": "b25lcGllY2UtYXBp.1_L3RlYWNoZXIvc3R1ZGVudC92aXBsZXNzb25z", "id1": "", "ruleName": "endpoint_resp_time_rule", "alarmMessage": "The average response time of endpoint [/one/more/endpoint in one-more-service] exceeded 1 second for 2 minutes in the last 10 minutes", "startTime": 1617670815000 }] gRPCHook Alert messages will be sent via gRPC remote methods using syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.skywalking.oap.server.core.alarm.grpc"; service AlarmService { rpc doAlarm (stream AlarmMessage) returns (Response) { } } message AlarmMessage { int64 scopeId = 1; string scope = 2; string name = 3; string id0 = 4; string id1 = 5; string ruleName = 6; string alarmMessage = 7; int64 startTime = 8; } message Response { } Slack Chat HookYou need to follow the Incoming Webhooks Getting Started guide and create new webhooks. If you have configured Slack Incoming Webhooks as follows, alert messages will be sent via HTTP For example: slackHooks: textTemplate: |- { "type": "section", "text": { "type": "mrkdwn", "text": ":alarm_clock: *Apache Skywalking Alarm* \n **%s**." } } webhooks: - https://hooks.slack.com/services/x/y/z WeChat HookOnly the enterprise version of WeChat supports Webhooks. For how to use WeChat's Webhooks, see How to Configure Group Robots. If you configure WeChat Webhooks as follows, the alert message will be sent via HTTP For example: wechatHooks: textTemplate: |- { "msgtype": "text", "text": { "content": "Apache SkyWalking warning: \n %s." } } webhooks: - https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=dummy_key DingTalk HookYou need to follow the custom bot opening and create new webhooks. For security purposes, you can configure an optional secret key for your webhook URL. If you configure DingTalk's Webhooks as follows, the alert message will be sent via HTTP For example: DingtalkHooks: textTemplate: |- { "msgtype": "text", "text": { "content": "Apache SkyWalking warning: \n %s." } } webhooks: - url: https://oapi.dingtalk.com/robot/send?access_token=dummy_token secret: dummysecret Scan the QR code on WeChat, follow Java Technology Fans , reply " e-books ", and get must-read Java technology books for free. This is the end of this article about the Apache SkyWalking alarm configuration guide. For more relevant SkyWalking alarm configuration content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Code comment writing standards during web page production
>>: Pure CSS to change the color of the picture
What are Routing and Routing Table in Linux? The ...
This tutorial is only applicable to Windows syste...
Encryption and decryption are an important means ...
Table of contents Explanation of v-text on if for...
1: nginx server solution, modify the .conf config...
Below, we introduce three ways to draw heart shap...
Following are the quick commands to clear disk sp...
MySQL foreign key constraint (FOREIGN KEY) is a s...
This article shares the specific code of the canv...
IMG tag basic analysis In HTML5, the img tag has ...
JS running trilogy js running code is divided int...
Using CSS layout to create web pages that comply w...
This article example shares the specific code of ...
wedge Because the MySQL version installed on the ...
Using the internal function instr in MySQL can re...