feat(loki-query): 移除loki-query部署 页面直接跳转grafana

This commit is contained in:
2024-02-04 16:37:40 +08:00
parent ccb5148e53
commit b8607dbdc4
5 changed files with 1 additions and 95 deletions

View File

@@ -97,18 +97,6 @@ deploy:
- name: service-info-query
source-jar: service-info-query-1.0.0-SNAPSHOT.jar
replicas: 10
- name: service-loki-query
source-jar: service-loki-query-1.0.0-SNAPSHOT.jar
replicas: 5
arguments:
spring_application_name: service-loki-query
loki_host: ${deploy.runtime.loki.service-url}
- name: service-loki-hudi-query
source-jar: service-loki-query-1.0.0-SNAPSHOT.jar
replicas: 10
arguments:
spring_application_name: service-loki-hudi-query
loki_host: ${deploy.runtime.loki.hudi-url}
- name: service-yarn-query
source-jar: service-yarn-query-1.0.0-SNAPSHOT.jar
replicas: 20

View File

@@ -1,18 +1,13 @@
package com.lanyuanxiaoyao.service.web.controller;
import cn.hutool.core.map.MapUtil;
import com.lanyuanxiaoyao.service.configuration.entity.loki.LokiLogLine;
import com.lanyuanxiaoyao.service.forest.service.InfoService;
import com.lanyuanxiaoyao.service.forest.service.loki.LokiHudiService;
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
import com.lanyuanxiaoyao.service.web.controller.base.AmisDetailResponse;
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
import com.lanyuanxiaoyao.service.web.controller.base.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -26,59 +21,13 @@ import org.springframework.web.bind.annotation.RestController;
public class LogController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(LogController.class);
private final LokiHudiService lokiHudiService;
private final InfoService infoService;
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
public LogController(LokiHudiService lokiHudiService, InfoService infoService) {
this.lokiHudiService = lokiHudiService;
public LogController(InfoService infoService) {
this.infoService = infoService;
}
private String preHandle(String line) {
return line
.replaceAll("\\n$", "")
.replaceAll("^\\s*(.+?)\\s*#@# :\\s*(.+?)\\s*$", "$1: $2");
}
@GetMapping("query_sync_log")
public AmisDetailResponse querySyncLog(@RequestParam("flink_job_id") Long flinkJobId) {
return AmisResponse.responseDetailData(lokiHudiService.queryRange(MapUtil.<String, String>builder()
.put("app", "hudi-sync")
.put("run_type", "sync")
.put("flink_job_id", flinkJobId.toString())
.put("limit", "1000")
.build())
.collect(LokiLogLine::getData)
.collect(this::preHandle)
.makeString("\n"));
}
@GetMapping("query_compaction_log")
public AmisDetailResponse queryCompactionLog(@RequestParam("flink_job_id") Long flinkJobId, @RequestParam("alias") String alias) {
return AmisResponse.responseDetailData(lokiHudiService.queryRange(MapUtil.<String, String>builder()
.put("app", "hudi-sync")
.put("run_type", "compaction")
.put("flink_job_id", flinkJobId.toString())
.put("alias", alias)
.put("limit", "1000")
.build())
.collect(LokiLogLine::getData)
.collect(this::preHandle)
.makeString("\n"));
}
@GetMapping("query_application_log")
public AmisDetailResponse queryApplicationLog(@RequestParam("application_id") String applicationId) {
return AmisResponse.responseDetailData(lokiHudiService.queryRange(MapUtil.<String, String>builder()
.put("app_id", applicationId)
.put("limit", "1000")
.build())
.collect(LokiLogLine::getData)
.collect(this::preHandle)
.makeString("\n"));
}
@GetMapping("query_sql_log")
public AmisCrudResponse querySQLLog() {
return AmisResponse.responseCrudData(infoService.sqlLogs());

View File

@@ -1,29 +0,0 @@
function logTab() {
return {
title: '运行中',
tab: [
{
type: 'service',
api: {
method: 'GET',
url: '${base}/log/query_compaction_log',
data: {
flink_job_id: '1646351885991305217',
alias: 'dz_mb_sys_login_log',
}
},
body: [
{
disabled: true,
type: 'editor',
name: 'detail',
label: '压缩日志',
options: {
wordWrap: 'on',
}
}
]
},
],
}
}

View File

@@ -41,7 +41,6 @@
<script src="components/cloud-tab.js"></script>
<script src="components/queue-tab.js"></script>
<script src="components/running-tab.js"></script>
<script src="components/log-tab.js"></script>
<script src="components/version-tab.js"></script>
<script src="components/overview-tab.js"></script>
<script src="components/tool-tab.js"></script>

View File

@@ -41,7 +41,6 @@
<script src="components/cloud-tab.js"></script>
<script src="components/queue-tab.js"></script>
<script src="components/running-tab.js"></script>
<script src="components/log-tab.js"></script>
<script src="components/version-tab.js"></script>
<script src="components/overview-tab.js"></script>
<script src="components/tool-tab.js"></script>