@@ -26,6 +26,7 @@ import (
2626 "github.com/prometheus/client_golang/prometheus"
2727
2828 api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
29+ "github.com/arangodb/kube-arangodb/pkg/deployment/features"
2930 "github.com/arangodb/kube-arangodb/pkg/generated/metric_descriptions"
3031 "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/throttle"
3132 "github.com/arangodb/kube-arangodb/pkg/util/metrics"
@@ -111,21 +112,34 @@ func (i *inventory) Collect(m chan<- prometheus.Metric) {
111112
112113 if spec .Mode .Get () == api .DeploymentModeCluster {
113114 for db , collections := range agency .Current .Collections {
115+ dbName := db
116+ if features .SensitiveInformationProtection ().Enabled () {
117+ dbName = "UNKNOWN"
118+
119+ if v , ok := agency .Plan .Databases [db ]; ok && v .ID != "" {
120+ dbName = v .ID
121+ }
122+ }
123+
114124 for collection , shards := range collections {
115125 for shard , details := range shards {
116126 for id , server := range details .Servers {
117- name := "UNKNOWN"
118- if _ , ok := agency .Plan .Collections [db ]; ok {
119- if _ , ok := agency .Plan .Collections [db ][collection ]; ok {
120- name = agency .Plan .Collections [db ][collection ].GetName (name )
127+ collectionName := "UNKNOWN"
128+ if features .SensitiveInformationProtection ().Enabled () {
129+ collectionName = collection
130+ } else {
131+ if _ , ok := agency .Plan .Collections [db ]; ok {
132+ if _ , ok := agency .Plan .Collections [db ][collection ]; ok {
133+ collectionName = agency .Plan .Collections [db ][collection ].GetName (collectionName )
134+ }
121135 }
122136 }
123137
124138 m := []string {
125139 deployment .GetNamespace (),
126140 deployment .GetName (),
127- db ,
128- name ,
141+ dbName ,
142+ collectionName ,
129143 shard ,
130144 string (server ),
131145 }
0 commit comments