当前位置: 首页 > news >正文

合肥网站建设多少钱wordpress改变域名

合肥网站建设多少钱,wordpress改变域名,物流网站建设方案权限管理,如何推广自己的微信公众号图片被吞,来这里看吧:https://juejin.cn/post/7344567669893021736 过年前一天发版,大家高高兴兴准备回家过年去了。这时候老板说了一句,记得带上电脑,关注用户反馈。有紧急问题在高速上都得给我找个服务区改好。 但是…

图片被吞,来这里看吧:https://juejin.cn/post/7344567669893021736

过年前一天发版,大家高高兴兴准备回家过年去了。这时候老板说了一句,记得带上电脑,关注用户反馈。有紧急问题在高速上都得给我找个服务区改好。

但是机智如我,怎么能让老板知道服务出问题了呢?毕竟我还奢望过完年有年终奖。那正确的方式当然服务出问题了,我们开发瞒着老板偷偷给他改了,当做什么都没发生过。

平时当然Bug多点无所谓,毕竟软件嘛,有点bug也正常。但现在是决定年终的重要时刻,我们要让老板相信我们的服务是稳定的。

1. 首先你要有个Skywalking

有条件玩K8S的同学看这个:在K8S集群中部署SkyWalking-CSDN博客

没条件就本地玩玩吧:SkyWalking 本地启动以及闪退问题-CSDN博客

告警相关配置文件路径:

打开后有一些默认的规则,这些规则的作用看这个:Alerting | Apache SkyWalking

rules:service_resp_time_rule:expression: sum(service_resp_time > 1000) >= 3period: 10silence-period: 5message: Response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes.service_sla_rule:expression: sum(service_sla < 8000) >= 2period: 10silence-period: 3message: Successful rate of service {name} is lower than 80% in 2 minutes of last 10 minutesservice_resp_time_percentile_rule:expression: sum(service_percentile{_='0,1,2,3,4'} > 1000) >= 3period: 10silence-period: 5message: Percentile response time of service {name} alarm in 3 minutes of last 10 minutes, due to more than one condition of p50 > 1000, p75 > 1000, p90 > 1000, p95 > 1000, p99 > 1000service_instance_resp_time_rule:expression: sum(service_instance_resp_time > 1000) >= 2period: 10silence-period: 5message: Response time of service instance {name} is more than 1000ms in 2 minutes of last 10 minutesdatabase_access_resp_time_rule:expression: sum(database_access_resp_time > 1000) >= 2period: 10message: Response time of database access {name} is more than 1000ms in 2 minutes of last 10 minutesendpoint_relation_resp_time_rule:expression: sum(endpoint_relation_resp_time > 1000) >= 2period: 10message: Response time of endpoint relation {name} is more than 1000ms in 2 minutes of last 10 minutes

2. 告警规则参数

Alerting | Apache SkyWalking

Rule name:规则名称。需要保证唯一,必须以 _rule 结尾

Expression:告警表达式。

Include names:告警规则生效包含的实体名列表。在 Skywalking中,实例有多种类型 Alerting | Apache SkyWalking

实体名称这里要注意一下,我们在集成 Agent 的时候,一般都会设置 Namespace 和 Service group。举个栗子: SW_AGENT_NAMESPACE:"dev" SW_AGENT_NAME:"dev::example-name"
当我这样定义时,service name 应该写成 dev::example-name|dev|,参考:Table of Agent Configuration Properties | Apache SkyWalking

Exclude names:告警规则不生效包含的实体名列表

Include names regex:和 Include names 一样。只不过是正则表达式字符串

Exclude names regex:和 Exclude names 一样。只不过是正则表达式字符串

Tags:自定义的 k-v 对

Period:表达式计算结果的缓存时间

Silence Period:推送最低间隔时间。例如我有一个规则,1分钟会触发一次,当我把Silence Period配置为 3 时。那就是每3分钟发送一次请求到 hook

Hooks:向外界发送通知的方式 ,本质上都是 WebHook。

3. 表达式解析

service_sla_custom_rule:# service_sla 是一个在 `alarm-config.yaml` 中默认定义的指标,当然可以覆盖它。# sum((service_sla / 100) < 90) 就是字面意思,服务SLA低于90% 的次数# >= 4 是关键,表达式每分钟算一次(这是我看了文档后猜的,应该没问题), 那这里就表示最近4分钟服务SLA都低于90%expression: sum((service_sla / 100) < 90) >= 4# 字符串匹配写法include-names:- 'dev::example|dev|'# 正则写法:所有dev组的include-names-regex: '^dev::.*' # 表达式计算结果缓存时长,表达式每一分钟计算一次,我表达式中设置了>=4# 所以period 应该设置一个大于4的值,这样能避免重复计算period: 10# 通知静默时长,如果服务有10分钟SLA是低于90的,那么m4的时候会提醒。# 下一次本来是m5提醒的,我设置了2,所以等到m6再次计算表达式的时候才会在提醒silence-period: 2# 自定义 tags,key-value形式tags:level: ERROR# 提醒文本,可以通过格式化插入参数message: '服务 SLA 低于 90%'# 使用的通知方式,如果不填则选择默认hookshooks:- '{hookType}.{hookName}'

4. 表达式定义实例

4.1 所有服务SLA在最近3分钟内小于100

service_success_rule:expression: sum((service_success / 100) < 100) >= 3period: 5silence-period: 5message: '服务 SLA 低于 100%'

4.2 单接口SLA在最近3分钟内小于100

endpoint_sla_rule:expression: sum((endpoint_sla / 100) < 100) >= 3include-names: - 'GET:/test/custom1 in dev::example|dev|'period: 5message: '此接口 SLA 低于 100%'

4.3 所有DB SLA 最近1分钟内小于100

database_access_sla_rule:expression: sum((database_access_sla / 100) < 100) >= 1period: 3message: 'DB SLA 低于 100%'

5. 定义配置 Hooks

实际测试下来,直接配置飞书会出现只有首次才会通知的情况。自己提供个Webhook在透传到飞书正常。猜测是Skywalking中集成飞书通知的模块有问题,这个待验证。

5.1 Webhook

Alerting | Apache SkyWalking

自定义的接口

@RestController  
@RequestMapping("/alerting")  
public class AlertingController {  // 我用的是lark,用飞书得改下hostprivate final static String WEBHOOK_URL = "https://open.larksuite.com/open-apis/bot/v2/hook/<token>";  @Resource  private RestTemplate restTemplate;  @PostMapping("skywalking")  public void alert(@RequestBody List<AlarmMessage> alarmMessageList) {  alarmMessageList.parallelStream().forEach(alarmMessage -> {  String text = "Apache SkyWalking Alarm:\n\n" +  alarmMessage.getScope() + ": " + alarmMessage.getName() + "\n\n" +  alarmMessage.getAlarmMessage();  ImmutableMap<String, Object> body = ImmutableMap.of(  "msg_type", "text",  "content", ImmutableMap.of("text", text)  );  restTemplate.postForEntity(WEBHOOK_URL, body, String.class);  });  }  // https://github.com/apache/skywalking/blob/master/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/alarm/AlarmMessage.java @Getter  @Setter    @JsonNaming(PropertyNamingStrategy.LowerCaseStrategy.class)  public static class AlarmMessage {  private int scopeId;  private String scope;  private String name;  private String id0;  private String id1;  @JsonAlias("ruleName")  private String ruleName;  @JsonAlias("alarmMessage")  private String alarmMessage;  private List<Tag> tags;  @JsonAlias("startTime")  private long startTime;  private transient int period;  }  @Getter  @Setter    public static class Tag {  private String key;  private String value;  }  
}

alarm-config.yaml 中配置

hooks:webhook:default:# 定义这是默认的hookis-default: trueurls:- http://localhost:8080/alerting/skywalking

5.2 飞书

创建机器人很简单的,基本上有手就行。

Alerting | Apache SkyWalking

自定义机器人使用指南 - 开发指南 - 开发文档 - Lark 开放平台 (larksuite.com)

飞书群机器人通知配置

hooks:feishu:default:text-template: |-{"msg_type": "text","content": {"text": "Apache SkyWalking Alarm: \n\n%s"}}webhooks:- url: https://open.larksuite.com/open-apis/bot/v2/hook/<token>- secret: <secret>

Ref

Alerting | Apache SkyWalking

https://skywalking.apache.org/docs/main/v9.7.0/en/api/metrics-query-expression

Analysis Native Streaming Traces and Service Mesh Traffic | Apache SkyWalking

skywalking/docs/en/setup/backend/backend-alarm.md at master · apache/skywalking (github.com)
skywalking/docs/en/api/metrics-query-expression.md at master · apache/skywalking (github.com)
自定义机器人使用指南 - 开发指南 - 开发文档 - Lark 开放平台 (larksuite.com)

Table of Agent Configuration Properties | Apache SkyWalking

http://www.yayakq.cn/news/730947/

相关文章:

  • 赤峰建设银行网站中网的官方网站
  • 成都销售型网站那些网站容易做淘宝推广
  • 建设公司网站的要点站长工具手机综合查询
  • 做网站百科宁波专业网站制作服务
  • 网站建设 专项资金变更wpzoom wordpress cms
  • 怎么发布自己做的网站网站开发有哪几类
  • 做网站 多页面网址怎么弄北京建机网站
  • 办公用纸网站建设现在注册公司需要什么条件
  • 如何更改网站的关键词蜘蛛网站长工作职责
  • 网站反链和外链的区别wordpress 图片大小设置
  • wordpress建站速度提升wordpress 增加中文
  • 买衣服网站排名wordpress主题开发ide
  • 公司网站的推广最专业的外贸网站建设
  • 做直播网站需要什么资质西安搬家公司电话号码
  • 小型网站开发小论文淘宝店铺网站建设可行性报告
  • 做1元夺宝网站挣钱吗wordpress图片广告插件
  • 设计网站公司都选亿企邦发表文章的平台有哪些
  • 网站建设案例 算命网站wordpress 下载主题慢
  • 摄影网站模板杭州学校网站开发
  • 长春网站建设q479185700強海外转运网站建设
  • 成品源码1688网站免费媒体资源网
  • 海外网站太慢电影网站模板
  • 网站信息内容建设 宣传部门网站网页制作的公司
  • 百度手机网站制作百度爱采购优化
  • 网站登陆模板下载app界面设计一页多少钱
  • 网站空间免费的能用吗临沂网
  • 推荐个好看的网站wordpress重构
  • 北京网站策划服务石家庄职业技术学院
  • 企业网站 静态页面小蘑菇网站开发
  • 网站做标题有用吗长春火车站附近美食