Skip to content

Commit

Permalink
feat(backend): mongodb 日志采集 #8191
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Nov 26, 2024
1 parent a3d0ff3 commit d1dced3
Show file tree
Hide file tree
Showing 4 changed files with 1,091 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbm-ui/backend/db_monitor/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def format_redis(cls):
def format_mssql(cls):
return cls.get_db_set_ctx(DBType.Sqlserver.value)

@classmethod
def format_mongodb(cls):
return cls.get_db_set_ctx(DBType.MongoDB.value)

@classmethod
def custom_modify_mysql_slowlog(cls, params):
"""
Expand Down
2 changes: 2 additions & 0 deletions dbm-ui/backend/db_monitor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ def create_bklog_collector(startswith: str = ""):
bklog_params = JsonConfigFormat.format(bklog_params, JsonConfigFormat.format_redis.__name__)
elif "mssql" in filename:
bklog_params = JsonConfigFormat.format(bklog_params, JsonConfigFormat.format_mssql.__name__)
elif "mongodb" in filename:
bklog_params = JsonConfigFormat.format(bklog_params, JsonConfigFormat.format_mongodb.__name__)
else:
logger.warning(_("格式化函数{log_name}不存在(如果无需格式化json可忽略)").format(log_name=log_name))

Expand Down
Loading

0 comments on commit d1dced3

Please sign in to comment.