Skip to content

Commit

Permalink
Merge pull request #38 from damsallem/main
Browse files Browse the repository at this point in the history
Fix the parsing of metaKey to resolve namespaces
  • Loading branch information
damsallem authored Feb 21, 2024
2 parents a030629 + 08c4244 commit 3441cf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/aerospike/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var (
TLSTag: "tls",
TLSHostnameMetaKey: "tls-hostname",
NamespaceMetaKey: "",
NamespaceMetaKeyPrefix: "",
NamespaceMetaKeyPrefix: "aerospike-monitoring-",
MonitoringSet: "monitoring",
LatencyKeyPrefix: "monitoring_latency_",
DurabilityKeyPrefix: "monitoring_durability_",
Expand Down
6 changes: 4 additions & 2 deletions pkg/aerospike/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ func (conf AerospikeProbeConfig) getNamespacesFromEntry(logger log.Logger, entry
if !ready {
continue
}
ns := strings.Split(metaKey, "-")[2] // MetaKey is like : "aerospike-monitoring-closeststore"
namespaces[ns] = struct{}{}
ns := metaKey[len(conf.AerospikeEndpointConfig.NamespaceMetaKeyPrefix):] // MetaKey is like : "aerospike-monitoring-closeststore"
if len(ns) > 0 {
namespaces[ns] = struct{}{}
}
}

// DEPRECATED way to get namespaces in case of fallback required or empty namespaces with the new method
Expand Down

0 comments on commit 3441cf9

Please sign in to comment.