Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查询超时也要记录日志 #2110

Merged
merged 3 commits into from
Jun 18, 2023
Merged

查询超时也要记录日志 #2110

merged 3 commits into from
Jun 18, 2023

Conversation

woshiyanghai
Copy link
Contributor

查询超时也要记录日志

@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.01 ⚠️

Comparison is base (59c89bc) 75.24% compared to head (b9f3247) 75.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2110      +/-   ##
==========================================
- Coverage   75.24%   75.24%   -0.01%     
==========================================
  Files         105      105              
  Lines       15182    15183       +1     
==========================================
  Hits        11424    11424              
- Misses       3758     3759       +1     
Impacted Files Coverage Δ
sql/query.py 70.55% <66.66%> (-0.44%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

hit_rule=query_result.mask_rule_hit,
masking=query_result.is_masked,
)
query_log.save()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好, 要不放进 finally 里面吧, 这样即使查询异常也有查询记录

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好,我觉得暂时没有必要记录查询异常情况,可以把查询过程中超时或者被kill处理,出现查询错误等情况记录下即可

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

调整后这个记录的位置已经是记录了异常情况,比如语法错误等

以前是query_result.error不存在才记录

var extraInfo = tabs[i].children[1].innerHTML+"|"+e.length;
var instance_name = $("#instance_name").val()
var db_name =$("#db_name").val()
var extraInfo = instance_name+"/"+db_name+"|"+$(tabs[i].children[1]).attr('sql_cache')+"|"+e.length;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实例和数据库本身已经有字段存储,不需要再额外追加

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前版本中记录下载的审计日志,获取sql语句是空的,只记录了下载的行数,具体是哪个sql的下载是不知道的

@hhyo hhyo merged commit a794389 into hhyo:master Jun 18, 2023
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants