UI 界面,增加 skywalking 作为日志中心

This commit is contained in:
YunaiV 2021-04-26 23:18:13 +08:00
parent 33412466bb
commit e65488265d
7 changed files with 37 additions and 8 deletions

View File

@ -27,6 +27,7 @@ JAVA_OPS="-Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$HE
export SW_AGENT_NAME=$SERVER_NAME
export SW_AGENT_COLLECTOR_BACKEND_SERVICES=192.168.0.84:11800
export SW_GRPC_LOG_SERVER_HOST=192.168.0.84
export SW_AGENT_TRACE_IGNORE_PATH="Redisson/PING,/actuator/**,/admin/**"
export JAVA_AGENT=-javaagent:/work/skywalking/apache-skywalking-apm-bin/agent/skywalking-agent.jar
# 备份

View File

@ -8,7 +8,7 @@ export default {
name: "SkyWalking",
data() {
return {
src: "http://skywalking.shop.iocoder.cn", // TODO
src: "http://skywalking.shop.iocoder.cn/trace", // TODO
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true
};

View File

@ -0,0 +1,26 @@
<template>
<div v-loading="loading" :style="'height:'+ height">
<iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
</div>
</template>
<script>
export default {
name: "SkyWalking-Log",
data() {
return {
src: "http://skywalking.shop.iocoder.cn/log", // TODO
height: document.documentElement.clientHeight - 94.5 + "px;",
loading: true
};
},
mounted: function() {
setTimeout(() => {
this.loading = false;
}, 230);
const that = this;
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + "px;";
};
}
};
</script>

View File

@ -5,6 +5,9 @@ import java.lang.annotation.*;
/**
* 打印业务编号 / 业务类型注解
*
* 使用时需要设置 SkyWalking OAP Server application.yaml 配置文件修改 SW_SEARCHABLE_TAG_KEYS 配置项
* 增加 biz.type biz.id 两值然后重启 SkyWalking OAP Server 服务器
*
* @author 麻薯
*/
@Target({ElementType.METHOD})

View File

@ -1,6 +1,6 @@
/**
* 链路追踪
* 使用 SkyWalking 组件作为链路追踪日志中心
*
* 主要目的是生成全局的链路追踪编号
* @author 芋道源码
*/
package cn.iocoder.dashboard.framework.tracer;

View File

@ -59,7 +59,6 @@ public class SysAuthController {
@GetMapping("/get-permission-info")
@ApiOperation("获取登陆用户的权限信息")
@BizTrace(id = "1", type = "'user'")
public CommonResult<SysAuthPermissionInfoRespVO> getPermissionInfo() {
// 获得用户信息
SysUserDO user = userService.getUser(getLoginUserId());

View File

@ -5,12 +5,11 @@ import cn.iocoder.dashboard.common.pojo.CommonResult;
import cn.iocoder.dashboard.common.pojo.PageResult;
import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
import cn.iocoder.dashboard.framework.logger.operatelog.core.annotations.OperateLog;
import cn.iocoder.dashboard.framework.tracer.core.annotation.BizTrace;
import cn.iocoder.dashboard.modules.tool.controller.test.vo.*;
import cn.iocoder.dashboard.modules.tool.convert.test.ToolTestDemoConvert;
import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
import cn.iocoder.dashboard.modules.tool.service.test.ToolTestDemoService;
import com.baomidou.lock.annotation.Lock4j;
import io.github.resilience4j.ratelimiter.annotation.RateLimiter;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@ -66,7 +65,7 @@ public class ToolTestDemoController {
@ApiOperation("获得测试示例")
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('tool:test-demo:query')")
@Lock4j // 分布式锁
// @Lock4j // 分布式锁
public CommonResult<ToolTestDemoRespVO> getTestDemo(@RequestParam("id") Long id) {
if (true) { // 测试分布式锁
ThreadUtil.sleep(5, TimeUnit.SECONDS);
@ -79,7 +78,8 @@ public class ToolTestDemoController {
@ApiOperation("获得测试示例列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('tool:test-demo:query')")
@RateLimiter(name = "backendA")
// @RateLimiter(name = "backendA")
@BizTrace(id = "1", type = "'user'")
public CommonResult<List<ToolTestDemoRespVO>> getTestDemoList(@RequestParam("ids") Collection<Long> ids) {
List<ToolTestDemoDO> list = testDemoService.getTestDemoList(ids);
return success(ToolTestDemoConvert.INSTANCE.convertList(list));