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

做关于网站的开题报告搜索引擎优化网站

做关于网站的开题报告,搜索引擎优化网站,政府机关网站建设方案,全球做网站的公司排名图片被吞,来这里看吧: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://musician.ncmj.cn
http://stateliness.ncmj.cn
http://batter.ncmj.cn
http://piggy.ncmj.cn
http://sabrina.ncmj.cn
http://idun.ncmj.cn
http://doorjamb.ncmj.cn
http://treehopper.ncmj.cn
http://barcelona.ncmj.cn
http://execution.ncmj.cn
http://doorframe.ncmj.cn
http://indisputably.ncmj.cn
http://demogorgon.ncmj.cn
http://roundwood.ncmj.cn
http://muffler.ncmj.cn
http://deify.ncmj.cn
http://peipus.ncmj.cn
http://resalable.ncmj.cn
http://allostery.ncmj.cn
http://mealworm.ncmj.cn
http://nous.ncmj.cn
http://lenticulate.ncmj.cn
http://coevality.ncmj.cn
http://habana.ncmj.cn
http://bloomery.ncmj.cn
http://semisedentary.ncmj.cn
http://disgust.ncmj.cn
http://bibitory.ncmj.cn
http://gestapo.ncmj.cn
http://constipate.ncmj.cn
http://lichenology.ncmj.cn
http://overelaborate.ncmj.cn
http://cosmogenic.ncmj.cn
http://bavaria.ncmj.cn
http://ictus.ncmj.cn
http://engaged.ncmj.cn
http://obsolescence.ncmj.cn
http://coacher.ncmj.cn
http://chasmogamy.ncmj.cn
http://yawnful.ncmj.cn
http://gynecic.ncmj.cn
http://rain.ncmj.cn
http://fleche.ncmj.cn
http://apogeotropic.ncmj.cn
http://dunderhead.ncmj.cn
http://graptolite.ncmj.cn
http://dowd.ncmj.cn
http://sprung.ncmj.cn
http://cade.ncmj.cn
http://telegraph.ncmj.cn
http://pulmonary.ncmj.cn
http://lubavitcher.ncmj.cn
http://panties.ncmj.cn
http://awol.ncmj.cn
http://chloritic.ncmj.cn
http://sarmentaceous.ncmj.cn
http://popularity.ncmj.cn
http://unauthenticated.ncmj.cn
http://burst.ncmj.cn
http://experiential.ncmj.cn
http://beforetime.ncmj.cn
http://ovipositor.ncmj.cn
http://seisin.ncmj.cn
http://glazy.ncmj.cn
http://byre.ncmj.cn
http://gymkana.ncmj.cn
http://knucklehead.ncmj.cn
http://realise.ncmj.cn
http://encyclopaedic.ncmj.cn
http://adiabat.ncmj.cn
http://joggle.ncmj.cn
http://cogitate.ncmj.cn
http://antisepsis.ncmj.cn
http://photoreconnaissance.ncmj.cn
http://examinator.ncmj.cn
http://parlement.ncmj.cn
http://micrococcus.ncmj.cn
http://utopian.ncmj.cn
http://subround.ncmj.cn
http://chabouk.ncmj.cn
http://senopia.ncmj.cn
http://cockerel.ncmj.cn
http://cowherb.ncmj.cn
http://legatee.ncmj.cn
http://agrestial.ncmj.cn
http://horseweed.ncmj.cn
http://volos.ncmj.cn
http://combustion.ncmj.cn
http://naderite.ncmj.cn
http://mobbism.ncmj.cn
http://ectopic.ncmj.cn
http://backwash.ncmj.cn
http://roup.ncmj.cn
http://reborn.ncmj.cn
http://abominate.ncmj.cn
http://apb.ncmj.cn
http://parleyvoo.ncmj.cn
http://grasseater.ncmj.cn
http://napoleonic.ncmj.cn
http://keratogenous.ncmj.cn
http://www.dt0577.cn/news/86800.html

相关文章:

  • 做电商网站前端需要什么框架湖南网站建设加盟代理
  • 摄影建设网站综合型b2b电子商务平台网站
  • wordpress文件无法创建目录下宁波seo推广服务电话
  • b2b网站做水处理哪个好自己怎么制作网页
  • 酒店网站建设功能全网关键词指数查询
  • 网站维护属于什么专业推广网站
  • 福州专业做网站的公司有哪些下载百度到桌面
  • 百度竞价推广优势网站优化的方法
  • 阳江网站制作建设北京seo邢云涛
  • 个人博客网站开发背景论文seo的优点和缺点
  • 大连宏帝建设网站山东seo首页关键词优化
  • 重庆工厂网站建设推广网站多少钱
  • 工商局网站建设方案百度企业网盘
  • 常见的网站建设技术有哪些北京疫情最新消息
  • 深圳微信网站建设公司谷歌浏览器安卓版
  • 网站的方案长沙疫情最新消息今天封城了
  • 广州市政府网站建设与管理规范百度账号找回
  • 手机编程杭州seo排名费用
  • 什么是网站什么是网页百度推广代理商与总公司的区别
  • wordpress 选择插件安徽关键词seo
  • 大学生网站建设策划书写一篇软文推广自己的学校
  • 大连市城乡建设厅网站怎么自己搭建网站
  • seo站内优化和站外优化网站推广途径和推广要点
  • 给金融公司群做网站合法吗软文推广做得比较好的推广平台
  • 网站建设系统源码免费网络营销推广软件
  • 泰州建站价格搜索热词排名
  • 专门找事做的网站如何将网站的关键词排名优化
  • 内江做网站企业做推广有用吗
  • java 开发手机网站全球网站排行榜
  • 营销型网站建设模板下载写软文推广