chore: fix some typos (#3316)

Signed-off-by: Nabil <nabilcharaf37@gmail.com>
This commit is contained in:
Nabil 2025-05-21 19:53:59 +02:00 committed by GitHub
parent 467d1f3d7d
commit e942bae99f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -22,12 +22,12 @@ import (
) )
const ( const (
cpuVulerabilitiesCollector = "cpu_vulnerabilities" cpuVulnerabilitiesCollectorSubsystem = "cpu_vulnerabilities"
) )
var ( var (
vulnerabilityDesc = prometheus.NewDesc( vulnerabilityDesc = prometheus.NewDesc(
prometheus.BuildFQName(namespace, cpuVulerabilitiesCollector, "info"), prometheus.BuildFQName(namespace, cpuVulnerabilitiesCollectorSubsystem, "info"),
"Details of each CPU vulnerability reported by sysfs. The value of the series is an int encoded state of the vulnerability. The same state is stored as a string in the label", "Details of each CPU vulnerability reported by sysfs. The value of the series is an int encoded state of the vulnerability. The same state is stored as a string in the label",
[]string{"codename", "state", "mitigation"}, []string{"codename", "state", "mitigation"},
nil, nil,
@ -37,7 +37,7 @@ var (
type cpuVulnerabilitiesCollector struct{} type cpuVulnerabilitiesCollector struct{}
func init() { func init() {
registerCollector(cpuVulerabilitiesCollector, defaultDisabled, NewVulnerabilitySysfsCollector) registerCollector(cpuVulnerabilitiesCollectorSubsystem, defaultDisabled, NewVulnerabilitySysfsCollector)
} }
func NewVulnerabilitySysfsCollector(logger *slog.Logger) (Collector, error) { func NewVulnerabilitySysfsCollector(logger *slog.Logger) (Collector, error) {

View file

@ -106,7 +106,7 @@ func (c *processCollector) Update(ch chan<- prometheus.Metric) error {
pidM, err := readUintFromFile(procFilePath("sys/kernel/pid_max")) pidM, err := readUintFromFile(procFilePath("sys/kernel/pid_max"))
if err != nil { if err != nil {
return fmt.Errorf("unable to retrieve limit number of maximum pids alloved: %w", err) return fmt.Errorf("unable to retrieve limit number of maximum pids allowed: %w", err)
} }
ch <- prometheus.MustNewConstMetric(c.pidUsed, prometheus.GaugeValue, float64(pids)) ch <- prometheus.MustNewConstMetric(c.pidUsed, prometheus.GaugeValue, float64(pids))
ch <- prometheus.MustNewConstMetric(c.pidMax, prometheus.GaugeValue, float64(pidM)) ch <- prometheus.MustNewConstMetric(c.pidMax, prometheus.GaugeValue, float64(pidM))

View file

@ -48,7 +48,7 @@ func TestReadProcessStatus(t *testing.T) {
} }
maxPid, err := readUintFromFile(procFilePath("sys/kernel/pid_max")) maxPid, err := readUintFromFile(procFilePath("sys/kernel/pid_max"))
if err != nil { if err != nil {
t.Fatalf("Unable to retrieve limit number of maximum pids alloved %v\n", err) t.Fatalf("Unable to retrieve limit number of maximum pids allowed %v\n", err)
} }
if uint64(pids) > maxPid || pids == 0 { if uint64(pids) > maxPid || pids == 0 {
t.Fatalf("Total running pids cannot be greater than %d or equals to 0", maxPid) t.Fatalf("Total running pids cannot be greater than %d or equals to 0", maxPid)