Skip to content

Commit

Permalink
PMM-3303 Monitor internal clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Apr 3, 2024
1 parent bd96196 commit f9b48f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 4 additions & 4 deletions managed/services/victoriametrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ package victoriametrics

import (
"github.com/AlekSi/pointer"
"github.com/percona/pmm/managed/models"
"github.com/percona/pmm/version"
config "github.com/percona/promconfig"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gopkg.in/reform.v1"

"github.com/percona/pmm/managed/models"
"github.com/percona/pmm/version"
)

// AddScrapeConfigs - adds agents scrape configuration to given scrape config,
Expand Down Expand Up @@ -209,7 +208,8 @@ func AddInternalServicesToScrape(cfg *config.Config, s models.MetricsResolutions
scrapeConfigForAlertmanager(s.MR),
scrapeConfigForGrafana(s.MR),
scrapeConfigForPMMManaged(s.MR),
scrapeConfigForQANAPI2(s.MR))
scrapeConfigForQANAPI2(s.MR),
scrapeConfigForClickhouse(s.MR))
// TODO Refactor to remove boolean positional parameter when Prometheus is removed
if dbaas {
cfg.ScrapeConfigs = append(cfg.ScrapeConfigs, scrapeConfigForDBaaSController(s.MR))
Expand Down
15 changes: 15 additions & 0 deletions managed/services/victoriametrics/scrape_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ func scrapeConfigForAlertmanager(interval time.Duration) *config.ScrapeConfig {
}
}

func scrapeConfigForClickhouse(mr time.Duration) *config.ScrapeConfig {
return &config.ScrapeConfig{
JobName: "clickhouse",
ScrapeInterval: config.Duration(mr),
ScrapeTimeout: scrapeTimeout(mr),
MetricsPath: "/metrics",
ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{
StaticConfigs: []*config.Group{{
Targets: []string{"127.0.0.1:9363"},
Labels: map[string]string{"instance": "pmm-server"},
}},
},
}
}

func scrapeConfigForGrafana(interval time.Duration) *config.ScrapeConfig {
return &config.ScrapeConfig{
JobName: "grafana",
Expand Down

0 comments on commit f9b48f0

Please sign in to comment.