Skip to content

fix(grafana): sync Loki datasource settings - #190

Open
singchia wants to merge 2 commits into
mainfrom
fix/issue-122-grafana-loki-sync
Open

singchia wants to merge 2 commits into
mainfrom
fix/issue-122-grafana-loki-sync

Conversation

@singchia

@singchia singchia commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

  • sync the Grafana Loki datasource from system_settings.loki during Grafana Sync
  • keep the legacy datasource field while returning all synced datasources
  • mark provisioned Loki datasources editable so Grafana API updates are allowed

Tests

  • go test ./internal/manager/biz/grafana

Fixes #122

Author confirmation

  • I have read and agree to the project contribution guide in CONTRIBUTING.md.

@singchia

Copy link
Copy Markdown
Member Author

补充了一轮 #122 修复,已推送 commit d582e2b

  • 新增只同步 Loki datasource 的 POST /v1/integrations/grafana/sync-loki
  • 保存 Loki 设置后自动调用该接口;
  • 不再因保存 Loki 配置而重新同步 Prometheus datasource 或覆盖 dashboard;
  • Grafana 未配置或同步失败时,Loki 设置仍保留,页面显示明确警告;
  • 增加接口鉴权/调用测试。

验证:

  • go test ./internal/manager/biz/grafana ./internal/manager/server/integration
  • go test ./internal/manager/...

均通过。

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.

外部 Loki 地址配置不生效 (External Loki URL setting is ignored)

1 participant