Skip to content

Comments

cluster: support ng-monitoring config via server_configs and per-instance overrides#2685

Open
boltandrke wants to merge 1 commit intopingcap:masterfrom
boltandrke:feat/ng-monitoring-server-configs
Open

cluster: support ng-monitoring config via server_configs and per-instance overrides#2685
boltandrke wants to merge 1 commit intopingcap:masterfrom
boltandrke:feat/ng-monitoring-server-configs

Conversation

@boltandrke
Copy link

What problem does this PR solve

Adds support for configuring ng-monitoring via topology YAML, addressing
the gap described in #2325.

Currently there is no way to set ng-monitoring configuration (e.g.
storage.type, storage.path, continuous_profiling.*) through
the topology YAML. The NgMonitoringConfig template is hardcoded with
no user-config merge step, unlike other components (PD/TiKV/TiDB) which
support server_configs + per-instance config overrides.

What is changed and how it works

  1. ServerConfigs.NGMonitoring — added ng_monitoring map[string]any to ServerConfigs for global ng-monitoring config
  2. PrometheusSpec.NgMonitoringConfig — added ng_monitoring_config map[string]any for per-instance overrides
  3. MonitorInstance.InitConfig — replaced template-based ngmonitoring.toml generation with map-based approach using Merge2Toml, following the same pattern as PD/TiKV/TiDB
  4. Example topology — updated with documented ng_monitoring and ng_monitoring_config sections

Usage

server_configs:
  ng_monitoring:
    storage.type: "sqlite"
    storage.path: "/tidb-data/prometheus-9090/docdb_sqlite"
    continuous_profiling.enable: true
    continuous_profiling.profile_seconds: 5

monitoring_servers:
  - host: 10.0.1.21
    ng_port: 12020
    ng_monitoring_config:
      continuous_profiling.data_retention_seconds: 259200

Check List

  • Code compiles (go build ./...)
  • All existing tests pass (go test ./pkg/cluster/spec/...)
  • New test added (TestNGMonitoringServerConfig)
  • Lint passes (make check — 0 issues)

Ref #2325

…ance overrides

Add ng_monitoring to ServerConfigs and NgMonitoringConfig to PrometheusSpec
so that ng-monitoring configuration (e.g. storage.type, storage.path,
continuous_profiling.*) can be set through the topology YAML.

Global config is set under server_configs.ng_monitoring, and per-instance
overrides under monitoring_servers[].ng_monitoring_config, following the
same merge pattern as PD/TiKV/TiDB.

Ref pingcap#2325
@ti-chi-bot ti-chi-bot bot requested review from breezewish and srstack February 21, 2026 13:43
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign bb7133 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 21, 2026

Welcome @boltandrke! It looks like this is your first PR to pingcap/tiup 🎉

@pingcap-cla-assistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution first-time-contributor size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant