apache / hertzbeat

Apache HertzBeat(incubating) is a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
https://hertzbeat.apache.org/
Apache License 2.0
5.53k stars 960 forks source link

[BUG] Monitor import error #2104

Closed Kylin-Guo closed 3 weeks ago

Kylin-Guo commented 3 months ago

Is there an existing issue for this?

Current Behavior

导入 Json 格式监控文件 图片

导入Yaml 格式监控文件 图片

导入Excel 格式监控文件 图片

日志报错如下,但并未出现 Json 及 Excel 格式导入时的报错信息 图片

Expected Behavior

正常导入

Steps To Reproduce

  1. 从 v1.5.0 版本HertzBeat中导出监控
  2. 在 v1.6.0 版本HertzBeat中导入数据
  3. 报错

Environment

HertzBeat version(s):v1.6.0

Debug logs

2024-06-20 11:44:47.661 [http-nio-1157-exec-2] ERROR org.apache.hertzbeat.manager.support.GlobalExceptionHandler Line:252 - [monitor]-[unknown error happen]-Global tag is not allowed: tag:yaml.org,2002:org.dromara.hertzbeat.manager.service.impl.AbstractImExportServiceImpl$ExportMonitorDTO in 'reader', line 1, column 3:

org.yaml.snakeyaml.composer.ComposerException: Global tag is not allowed: tag:yaml.org,2002:org.dromara.hertzbeat.manager.service.impl.AbstractImExportServiceImpl$ExportMonitorDTO in 'reader', line 1, column 3:

Anything else?

No response

zhangshenghang commented 3 months ago

Yes, I also found the same problem. It was because some yml field names were modified, and method was changed to httpMethod. The yml files involved were: api and api_code.

Suggested modification method: Manually change method under api and api_code type monitoring in the json file exported from version 1.5 to httpMethod

image

This issue is caused by #1978

Kylin-Guo commented 3 months ago

I had change method to httpMethod on the json file, its works,thx a lot!