Skip to content

Commit f0474e6

Browse files
kylos101ona-agent
andcommitted
Cleanup
Co-authored-by: Ona <[email protected]>
1 parent 8f1aa7a commit f0474e6

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

components/ee/agent-smith/pkg/classifier/classifier.go

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,6 @@ func NewSignatureMatchClassifier(name string, defaultLevel Level, sig []*Signatu
160160
"classifier_name": name,
161161
},
162162
}),
163-
filesystemHitTotal: prometheus.NewCounter(prometheus.CounterOpts{
164-
Namespace: "gitpod_agent_smith",
165-
Subsystem: "classifier_signature",
166-
Name: "filesystem_hit_total",
167-
Help: "total count of filesystem signature hits",
168-
ConstLabels: prometheus.Labels{
169-
"classifier_name": name,
170-
},
171-
}),
172-
filesystemMissTotal: prometheus.NewCounterVec(prometheus.CounterOpts{
173-
Namespace: "gitpod_agent_smith",
174-
Subsystem: "classifier_signature",
175-
Name: "filesystem_miss_total",
176-
Help: "total count of filesystem signature misses",
177-
ConstLabels: prometheus.Labels{
178-
"classifier_name": name,
179-
},
180-
}, []string{"reason"}),
181163
}
182164
}
183165

@@ -194,10 +176,8 @@ type SignatureMatchClassifier struct {
194176
Signatures []*Signature
195177
DefaultLevel Level
196178

197-
processMissTotal *prometheus.CounterVec
198-
signatureHitTotal prometheus.Counter
199-
filesystemHitTotal prometheus.Counter
200-
filesystemMissTotal *prometheus.CounterVec
179+
processMissTotal *prometheus.CounterVec
180+
signatureHitTotal prometheus.Counter
201181
}
202182

203183
var _ ProcessClassifier = &SignatureMatchClassifier{}
@@ -276,7 +256,6 @@ func (sigcl *SignatureMatchClassifier) MatchesFile(filePath string) (c *Classifi
276256
} else {
277257
reason = processMissOther
278258
}
279-
sigcl.filesystemMissTotal.WithLabelValues(reason).Inc()
280259
log.WithFields(logrus.Fields{
281260
"filePath": filePath,
282261
"reason": reason,
@@ -293,7 +272,6 @@ func (sigcl *SignatureMatchClassifier) MatchesFile(filePath string) (c *Classifi
293272
for _, sig := range matchingSignatures {
294273
match, err := sig.Matches(&src)
295274
if match {
296-
sigcl.filesystemHitTotal.Inc()
297275
return &Classification{
298276
Level: sigcl.DefaultLevel,
299277
Classifier: ClassifierSignature,
@@ -321,15 +299,11 @@ type SignatureReadCache struct {
321299
func (sigcl *SignatureMatchClassifier) Describe(d chan<- *prometheus.Desc) {
322300
sigcl.processMissTotal.Describe(d)
323301
sigcl.signatureHitTotal.Describe(d)
324-
sigcl.filesystemHitTotal.Describe(d)
325-
sigcl.filesystemMissTotal.Describe(d)
326302
}
327303

328304
func (sigcl *SignatureMatchClassifier) Collect(m chan<- prometheus.Metric) {
329305
sigcl.processMissTotal.Collect(m)
330306
sigcl.signatureHitTotal.Collect(m)
331-
sigcl.filesystemHitTotal.Collect(m)
332-
sigcl.filesystemMissTotal.Collect(m)
333307
}
334308

335309
// GetFileSignatures returns signatures that are configured for filesystem domain

0 commit comments

Comments
 (0)