sentinel监控不到2级接口?加上@SentinelResource就可以?
发表于|更新于
|浏览量:
真正的快乐是内在的,它只有在人类的心灵里才能发现。——布雷默
如果出现这种问题啊
可以看你的项目启动日志
发现输出如下一句话
2021-03-16 23:24:49.986 INFO 18604 — [ main] c.a.c.s.SentinelWebAutoConfiguration : [Sentinel Starter] register SentinelWebInterceptor with urlPatterns: [/*].
看到这句话差不多懂了吧?
Sentinel提供的SentinelWebInterceptor的urlPatterns默认为/*
我们跟踪配置文件com.alibaba.cloud.sentinel.SentinelProperties
找到这个配置
1 | spring: |
我们设置为/**后,所有接口都会被监控到啦~


相关推荐
2022-07-23
stream拓展
开成花灾的玫瑰不是灿烂,而是荒凉。——严歌苓 源码地址:https://gitee.com/VampireAchao/stream-query/blob/master/stream-core/src/main/java/io/github/vampireachao/stream/core/stream/Steam.java 测试用例: https://gitee.com/VampireAchao/stream-query/blob/master/stream-core/src/test/java/io/github/vampireachao/stream/core/stream/SteamTest.java 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798...
2020-08-13
fastjson基本使用
alibaba的fastjson真香啊 首先是依赖 123456<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --><dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.73</version></dependency> 这里列举点简单的应用 首先是对象转JSON 1234567Map<String, Object> map = new HashMap<>(1 << 3);map.put("data", "操作成功!");map.put("code", 200);map.put("success", true);map.put("...
2023-05-03
为shenyu的PortUtils.findPort添加单元测试
爱好自由是人的天性,但往往过度而陷于放纵。斯宾诺莎 今天为shenyu的shenyu-client-core模块下添加了PortUtils.findPort的test case: https://github.com/apache/shenyu/pull/4604 对应的代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Ve...
2022-07-13
泛型限定问题
双木非林,田下有心。——顾城 首先看这段代码: 12345678910111213141516171819202122import java.util.function.Function;class Scratch { static class RoleInfo { } public static void main(String[] args) { // 想让这两个通过 test(Object::hashCode, RoleInfo::hashCode, new RoleInfo()); test(Object::toString, RoleInfo::toString, new RoleInfo()); // 想让这个报错 test(Object::hashCode, RoleInfo::toString, new RoleInfo()); } public static <T, A, R> void te...
2021-07-22
创建只读集合
真正的人生,只有在经过艰难卓绝的斗争之后才能实现。——塞涅卡 在java8中 我们可以使用下面的函数创建只读集合 12345678Collections.unmodifiableCollection(Arrays.asList(""));Collections.unmodifiableList(Collections.singletonList(""));Collections.unmodifiableMap(new HashMap<>(1 << 4));Collections.unmodifiableSet(new HashSet<>());Collections.unmodifiableNavigableMap(new TreeMap<>());Collections.unmodifiableNavigableSet(new TreeSet<>());Collections.unmodifiableSortedMap(new TreeMap<>());Colle...
2021-06-14
collect补充
青年之文明,奋斗之文明也,与境遇奋斗,与时代奋斗,与经验奋斗。故青年者,人生,人生之春,人生之华也。——李大钊 书接上文,我们讲到并行流场景下三个参数的reduce会有一个坑 同理,在collect函数中也有这个坑 我们先使用普通流去做 123456789101112131415161718192021222324252627282930// 生成1-100List<Integer> list = Stream.iterate(1, i -> ++i).limit(200).collect(Collectors.toList());System.out.println(list);// 使用collect函数进行转换为List<Map<Integer,Integer>>,包含值和线程idList<Map<String, Object>> result = list.stream().collect(() -> { System.out.println("第一个参数:Supplie...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog