Skip to content

feat(metadata): 支持将 Storage 配置同步到 Consul 与 Redis - #11710

Open
Zhaoyikaiii wants to merge 1 commit into
TencentBlueKing:masterfrom
Zhaoyikaiii:feat/metadata-storage-consul-redis
Open

feat(metadata): 支持将 Storage 配置同步到 Consul 与 Redis#11710
Zhaoyikaiii wants to merge 1 commit into
TencentBlueKing:masterfrom
Zhaoyikaiii:feat/metadata-storage-consul-redis

Conversation

@Zhaoyikaiii

@Zhaoyikaiii Zhaoyikaiii commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

变更内容

  • feat(metadata): 支持将 Storage 和 Feature Flag 配置同步到 Consul 与 Redis #11685 拆出 Metadata Storage 生产链路,不包含 Feature Flag 发布逻辑。
  • 保留 Storage Consul 发布,并新增 Redis 全量发布、失效 Key 清理与 Pub/Sub 通知。
  • 定时刷新时分别尝试 Consul 与 Redis,任一目标失败都会记录失败状态。
  • 新增带全局管理员权限的 Consul / Redis Storage 配置检查接口,响应中的密码已脱敏。
  • 补充 Consul、Redis、失效 Key 清理、错误传播和通知相关测试。

与消费端的关系

本 PR 对应 bkmonitor-datalink #1198。metadata 负责生产 Storage 配置,unify-query 根据 storage.source 从 Consul 或 Redis 加载并热更新运行时 Storage Map。

拆分说明

#11685 同时包含 Storage 与 Feature Flag,现已拆分为独立 PR。本 PR 仅负责 Storage;Feature Flag 链路见 #11711,后者读取 Redis 快照并同步至 Consul。两个 PR 均已同步至最新 master,可独立进行 review。

验证

  • ruff check:通过
  • Python compileall:通过
  • git diff --check:通过
  • 聚焦 pytest 已尝试;当前环境缺少 bk_monitor_base / rum_web,Django 在测试收集前无法初始化,需要 CI 或标准 bk-monitor 环境完成测试。

@github-actions

Copy link
Copy Markdown

请在 PR 中添加项目标签,例如:project/monitorproject/apmproject/logproject/publicproject/aiops

@github-actions

Copy link
Copy Markdown

请在 PR 中添加类型标签,例如:fixfeatdocsstylerefactortestchoremerge, perf

@Zhaoyikaiii Zhaoyikaiii added feat A new feature. Correlates with MINOR in SemVer project/monitor project monitor labels Jul 29, 2026 — with ChatGPT Codex Connector

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 4215020339

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Zhaoyikaiii

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@Zhaoyikaiii

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca10a65aec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bkmonitor/metadata/models/storage.py
Comment thread bkmonitor/metadata/models/storage.py Outdated
Comment thread bkmonitor/metadata/models/storage.py
@Zhaoyikaiii

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e26a0b85d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bkmonitor/metadata/models/storage.py
@Zhaoyikaiii

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: afd4b83012

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Zhaoyikaiii

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 3cec461ae7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Zhaoyikaiii
Zhaoyikaiii marked this pull request as ready for review July 30, 2026 08:05
@Zhaoyikaiii
Zhaoyikaiii force-pushed the feat/metadata-storage-consul-redis branch from 4e19b45 to c6c56fb Compare July 31, 2026 03:59
@Zhaoyikaiii
Zhaoyikaiii force-pushed the feat/metadata-storage-consul-redis branch from c6c56fb to d0c4cbf Compare July 31, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat A new feature. Correlates with MINOR in SemVer project/monitor project monitor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant