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

collector: remove windows_exporter_perflib_snapshot_duration_seconds metric #1760

Merged
merged 2 commits into from
Nov 22, 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
4 changes: 0 additions & 4 deletions internal/collector/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ func (c *Collector) GetName() string {
return Name
}

func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
return []string{}, nil
}

func (c *Collector) Close() error {
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions internal/collector/mscluster/mscluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ func (c *Collector) GetName() string {
return Name
}

func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
return []string{"Memory"}, nil
}

func (c *Collector) Close() error {
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions internal/collector/smtp/smtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ func (c *Collector) GetName() string {
return Name
}

func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
return []string{"SMTP Server"}, nil
}

func (c *Collector) Close() error {
c.perfDataCollector.Close()

Expand Down
17 changes: 2 additions & 15 deletions pkg/collector/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type Prometheus struct {
collectorScrapeDurationDesc *prometheus.Desc
collectorScrapeSuccessDesc *prometheus.Desc
collectorScrapeTimeoutDesc *prometheus.Desc
snapshotDuration *prometheus.Desc
}

type collectorStatus struct {
Expand Down Expand Up @@ -76,12 +75,6 @@ func (c *MetricCollectors) NewPrometheusCollector(timeout time.Duration, logger
[]string{"collector"},
nil,
),
snapshotDuration: prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, "exporter", "perflib_snapshot_duration_seconds"),
"Duration of perflib snapshot capture",
nil,
nil,
),
}
}

Expand All @@ -90,13 +83,7 @@ func (p *Prometheus) Describe(_ chan<- *prometheus.Desc) {}
// Collect sends the collected metrics from each of the MetricCollectors to
// prometheus.
func (p *Prometheus) Collect(ch chan<- prometheus.Metric) {
t := time.Now()

ch <- prometheus.MustNewConstMetric(
p.snapshotDuration,
prometheus.GaugeValue,
time.Since(t).Seconds(),
)
collectorStartTime := time.Now()

// WaitGroup to wait for all collectors to finish
wg := sync.WaitGroup{}
Expand Down Expand Up @@ -153,7 +140,7 @@ func (p *Prometheus) Collect(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(
p.scrapeDurationDesc,
prometheus.GaugeValue,
time.Since(t).Seconds(),
time.Since(collectorStartTime).Seconds(),
)
}

Expand Down
2 changes: 0 additions & 2 deletions tools/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ windows_exporter_collector_timeout{collector="tcp"} 0
windows_exporter_collector_timeout{collector="textfile"} 0
windows_exporter_collector_timeout{collector="time"} 0
windows_exporter_collector_timeout{collector="udp"} 0
# HELP windows_exporter_perflib_snapshot_duration_seconds Duration of perflib snapshot capture
# TYPE windows_exporter_perflib_snapshot_duration_seconds gauge
# HELP windows_exporter_scrape_duration_seconds windows_exporter: Total scrape duration.
# TYPE windows_exporter_scrape_duration_seconds gauge
# HELP windows_logical_disk_avg_read_requests_queued Average number of read requests that were queued for the selected disk during the sample interval (LogicalDisk.AvgDiskReadQueueLength)
Expand Down
2 changes: 1 addition & 1 deletion tools/end-to-end-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mkdir $textfile_dir | Out-Null
Copy-Item 'e2e-textfile.prom' -Destination "$($textfile_dir)/e2e-textfile.prom"

# Omit dynamic collector information that will change after each run
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_perflib_snapshot_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_cache|windows_logon|windows_pagefile|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_printer|windows_udp|windows_tcp|windows_system|windows_time|windows_session|windows_perfdata|windows_textfile_mtime_seconds)"
$skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duration_seconds|windows_exporter_scrape_duration_seconds|process_|windows_textfile_mtime_seconds|windows_cpu|windows_cs|windows_cache|windows_logon|windows_pagefile|windows_logical_disk|windows_physical_disk|windows_memory|windows_net|windows_os|windows_process|windows_service_process|windows_printer|windows_udp|windows_tcp|windows_system|windows_time|windows_session|windows_perfdata|windows_textfile_mtime_seconds)"

# Start process in background, awaiting HTTP requests.
# Use default collectors, port and address: http://localhost:9182/metrics
Expand Down