Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric configuration for filter list (whitelist and blacklist) #640

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ type Cluster struct {
SlavesOldestMasterFile SlavesOldestMasterFile
SlavesConnected int
clog *clog.Logger `json:"-"`
*ClusterGraphite
}

type SlavesOldestMasterFile struct {
Expand Down Expand Up @@ -329,7 +330,7 @@ func (cluster *Cluster) Init(confs *config.ConfVersion, cfgGroup string, tlog *s
cluster.repmgrVersion = repmgrVersion

cluster.InitFromConf()

cluster.NewClusterGraphite()
return nil
}

Expand Down
11 changes: 11 additions & 0 deletions cluster/cluster_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,17 @@ func (cluster *Cluster) IsURLPassACL(strUser string, URL string) bool {
return true
}
}
if cluster.APIUsers[strUser].Grants[config.GrantClusterConfigGraphs] {
if strings.Contains(URL, "/api/clusters/"+cluster.Name+"/settings/actions/set-graphite-filterlist") {
return true
}
if strings.Contains(URL, "/api/clusters/"+cluster.Name+"/settings/actions/reload-graphite-filterlist") {
return true
}
if strings.Contains(URL, "/api/clusters/"+cluster.Name+"/settings/actions/reset-graphite-filterlist") {
return true
}
}
/* case cluster.APIUsers[strUser].Grants[config.GrantClusterGrant] == true:
return false
case cluster.APIUsers[strUser].Grants[config.GrantClusterDropMonitor] == true:
Expand Down
Loading