mcp-log-query-server 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.js +25 -1
- package/index.js +910 -910
- package/logger.js +27 -17
- package/loki-client.js +13 -5
- package/package.json +3 -3
package/config.js
CHANGED
|
@@ -586,10 +586,26 @@ export const LOKI_ENVIRONMENTS = {
|
|
|
586
586
|
orgId: parseInt(process.env.MCP_GRAFANA_ORG_ID || '1'),
|
|
587
587
|
username: process.env.MCP_GRAFANA_USER || 'loki',
|
|
588
588
|
password: process.env.MCP_GRAFANA_PASSWORD || 'nihao123!!',
|
|
589
|
-
defaultProject: 'senior',
|
|
589
|
+
defaultProject: 'senior', // 用于 {project="senior"} label 过滤
|
|
590
|
+
pathProject: 'senior', // 用于 filename 路径中的 project 段
|
|
590
591
|
hasProjectLabel: true // CMS 有 project 标签,可用 {project="senior"} 查询
|
|
591
592
|
},
|
|
592
593
|
|
|
594
|
+
// 预发布环境(华为云)— 共享 CMS 的 Grafana / Loki,仅 project 标签为 pre-senior
|
|
595
|
+
// 注意:filename 路径里的 project 段仍然是 'senior'(不是 'pre-senior'),所以 pathProject 单独配置
|
|
596
|
+
'pre': {
|
|
597
|
+
description: '预发布环境(华为云,与 CMS 共用 Grafana)',
|
|
598
|
+
grafanaUrl: process.env.MCP_GRAFANA_URL || 'http://10.6.14.2:3000',
|
|
599
|
+
datasourceUid: process.env.MCP_GRAFANA_LOKI_UID || 'af2718a2-9c32-4364-a495-3bb29035199c',
|
|
600
|
+
datasourceId: parseInt(process.env.MCP_GRAFANA_DATASOURCE_ID || '35'),
|
|
601
|
+
orgId: parseInt(process.env.MCP_GRAFANA_ORG_ID || '1'),
|
|
602
|
+
username: process.env.MCP_GRAFANA_USER || 'loki',
|
|
603
|
+
password: process.env.MCP_GRAFANA_PASSWORD || 'nihao123!!',
|
|
604
|
+
defaultProject: 'pre-senior', // 用于 {project="pre-senior"} label 过滤
|
|
605
|
+
pathProject: 'senior', // filename 路径里仍是 senior(注意:与 label 不同)
|
|
606
|
+
hasProjectLabel: true
|
|
607
|
+
},
|
|
608
|
+
|
|
593
609
|
// ---- 私有化环境(均无 project 标签,通过 filename 正则匹配) ----
|
|
594
610
|
|
|
595
611
|
// 城阳私有化
|
|
@@ -669,6 +685,14 @@ export const LOKI_ENV_ALIASES = {
|
|
|
669
685
|
'生产': 'cms',
|
|
670
686
|
'生产环境': 'cms',
|
|
671
687
|
'cms': 'cms',
|
|
688
|
+
// 预发布
|
|
689
|
+
'pre': 'pre',
|
|
690
|
+
'preprod': 'pre',
|
|
691
|
+
'pre-prod': 'pre',
|
|
692
|
+
'staging': 'pre',
|
|
693
|
+
'预发': 'pre',
|
|
694
|
+
'预发布': 'pre',
|
|
695
|
+
'预发布环境': 'pre',
|
|
672
696
|
// 城阳
|
|
673
697
|
'城阳': 'chengyang',
|
|
674
698
|
'chengyang': 'chengyang',
|