mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
cs: remove deprecated cs collector (#2115)
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<configuration default="false" name="all" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="run">
|
<configuration default="false" name="all" type="GoApplicationRunConfiguration" factoryName="Go Application" folderName="run">
|
||||||
<module name="windows_exporter" />
|
<module name="windows_exporter" />
|
||||||
<working_directory value="$PROJECT_DIR$" />
|
<working_directory value="$PROJECT_DIR$" />
|
||||||
<parameters value="--web.listen-address=127.0.0.1:9182 --log.level=info --collectors.enabled=ad,adcs,adfs,cache,container,cpu,cpu_info,cs,dfsr,dhcp,diskdrive,dns,exchange,filetime,fsrmquota,hyperv,iis,license,logical_disk,memory,mscluster,msmq,mssql,net,netframework,nps,os,pagefile,performancecounter,physical_disk,printer,process,remote_fx,scheduled_task,service,smb,smbclient,smtp,system,tcp,terminal_services,thermalzone,time,udp,update,vmware,performancecounter --debug.enabled --collector.performancecounter.objects='[{ "name": "memory", "type": "formatted", "object": "Memory", "counters": [{ "name":"Cache Faults/sec", "type":"counter" }]}]'" />
|
<parameters value="--web.listen-address=127.0.0.1:9182 --log.level=info --collectors.enabled=ad,adcs,adfs,cache,container,cpu,cpu_info,dfsr,dhcp,diskdrive,dns,exchange,filetime,fsrmquota,hyperv,iis,license,logical_disk,memory,mscluster,msmq,mssql,net,netframework,nps,os,pagefile,performancecounter,physical_disk,printer,process,remote_fx,scheduled_task,service,smb,smbclient,smtp,system,tcp,terminal_services,thermalzone,time,udp,update,vmware,performancecounter --debug.enabled --collector.performancecounter.objects='[{ "name": "memory", "type": "formatted", "object": "Memory", "counters": [{ "name":"Cache Faults/sec", "type":"counter" }]}]'" />
|
||||||
<sudo value="true" />
|
<sudo value="true" />
|
||||||
<kind value="PACKAGE" />
|
<kind value="PACKAGE" />
|
||||||
<package value="github.com/prometheus-community/windows_exporter/cmd/windows_exporter" />
|
<package value="github.com/prometheus-community/windows_exporter/cmd/windows_exporter" />
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ A Prometheus exporter for Windows machines.
|
|||||||
| [cache](docs/collector.cache.md) | Cache metrics | |
|
| [cache](docs/collector.cache.md) | Cache metrics | |
|
||||||
| [cpu](docs/collector.cpu.md) | CPU usage | ✓ |
|
| [cpu](docs/collector.cpu.md) | CPU usage | ✓ |
|
||||||
| [cpu_info](docs/collector.cpu_info.md) | CPU Information | |
|
| [cpu_info](docs/collector.cpu_info.md) | CPU Information | |
|
||||||
| [cs](docs/collector.cs.md) | "Computer System" metrics (system properties, num cpus/total memory) | |
|
|
||||||
| [container](docs/collector.container.md) | Container metrics | |
|
| [container](docs/collector.container.md) | Container metrics | |
|
||||||
| [diskdrive](docs/collector.diskdrive.md) | Diskdrive metrics | |
|
| [diskdrive](docs/collector.diskdrive.md) | Diskdrive metrics | |
|
||||||
| [dfsr](docs/collector.dfsr.md) | DFSR metrics | |
|
| [dfsr](docs/collector.dfsr.md) | DFSR metrics | |
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ This directory contains documentation of the collectors in the windows_exporter,
|
|||||||
- [`container`](collector.container.md)
|
- [`container`](collector.container.md)
|
||||||
- [`cpu`](collector.cpu.md)
|
- [`cpu`](collector.cpu.md)
|
||||||
- [`cpu_info`](collector.cpu_info.md)
|
- [`cpu_info`](collector.cpu_info.md)
|
||||||
- [`cs`](collector.cs.md)
|
|
||||||
- [`dfsr`](collector.dfsr.md)
|
- [`dfsr`](collector.dfsr.md)
|
||||||
- [`dhcp`](collector.dhcp.md)
|
- [`dhcp`](collector.dhcp.md)
|
||||||
- [`diskdrive`](collector.diskdrive.md)
|
- [`diskdrive`](collector.diskdrive.md)
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
# cs collector
|
|
||||||
|
|
||||||
> [!CAUTION]
|
|
||||||
> This collector is deprecated and will be removed in a future release.
|
|
||||||
> See https://github.com/prometheus-community/windows_exporter/pull/1596 for more information.
|
|
||||||
|
|
||||||
The cs collector exposes metrics detailing the hardware of the computer system
|
|
||||||
|
|
||||||
|||
|
|
||||||
-|-
|
|
||||||
Metric name prefix | `cs`
|
|
||||||
Classes | [`Win32_ComputerSystem`](https://msdn.microsoft.com/en-us/library/aa394102)
|
|
||||||
Enabled by default? | Yes
|
|
||||||
|
|
||||||
## Flags
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
Name | Description | Type | Labels
|
|
||||||
-----|-------------|------|-------
|
|
||||||
`windows_cs_logical_processors` | Number of installed logical processors | gauge | None
|
|
||||||
`windows_cs_physical_memory_bytes` | Total installed physical memory | gauge | None
|
|
||||||
`windows_cs_hostname` | Labelled system hostname information | gauge | `hostname`, `domain`, `fqdn`
|
|
||||||
|
|
||||||
### Example metric
|
|
||||||
_This collector does not yet have explained examples, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Useful queries
|
|
||||||
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
|
||||||
|
|
||||||
## Alerting examples
|
|
||||||
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
# Note this is not an exhaustive list of all configuration values
|
# Note this is not an exhaustive list of all configuration values
|
||||||
collectors:
|
collectors:
|
||||||
enabled: cpu,cs,logical_disk,net,os,service,system
|
enabled: cpu,logical_disk,net,os,service,system
|
||||||
collector:
|
collector:
|
||||||
service:
|
service:
|
||||||
include: "windows_exporter"
|
include: "windows_exporter"
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}windows_exporter configuration" />
|
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}windows_exporter configuration" />
|
||||||
|
|
||||||
<!-- Edit box for property input -->
|
<!-- Edit box for property input -->
|
||||||
<!-- cpu,cs,logical_disk,physical_disk,net,os,service,system -->
|
<!-- cpu,logical_disk,physical_disk,net,os,service,system -->
|
||||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title1" Type="Text" X="25" Y="55" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="Comma-separated list of collectors to use. Use '[\[]defaults[\]]' as a placeholder for all" />
|
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title1" Type="Text" X="25" Y="55" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="Comma-separated list of collectors to use. Use '[\[]defaults[\]]' as a placeholder for all" />
|
||||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title2" Type="Text" X="25" Y="65" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="the collectors enabled by default. If value is empty, the exporter default will be used." />
|
<Control Id="PropertyEdit_ENABLED_COLLECTORS_Title2" Type="Text" X="25" Y="65" Width="300" Height="15" Transparent="yes" NoPrefix="yes" Text="the collectors enabled by default. If value is empty, the exporter default will be used." />
|
||||||
<Control Id="PropertyEdit_ENABLED_COLLECTORS" Type="Edit" X="24" Y="77" Width="300" Height="18" Property="ENABLED_COLLECTORS" Text="[ENABLED_COLLECTORS]" Indirect="no" />
|
<Control Id="PropertyEdit_ENABLED_COLLECTORS" Type="Edit" X="24" Y="77" Width="300" Height="18" Property="ENABLED_COLLECTORS" Text="[ENABLED_COLLECTORS]" Indirect="no" />
|
||||||
|
|||||||
@@ -1,157 +0,0 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
//
|
|
||||||
// Copyright The Prometheus Authors
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
//go:build windows
|
|
||||||
|
|
||||||
package cs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log/slog"
|
|
||||||
|
|
||||||
"github.com/alecthomas/kingpin/v2"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/headers/sysinfoapi"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/mi"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/types"
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
)
|
|
||||||
|
|
||||||
const Name = "cs"
|
|
||||||
|
|
||||||
type Config struct{}
|
|
||||||
|
|
||||||
//nolint:gochecknoglobals
|
|
||||||
var ConfigDefaults = Config{}
|
|
||||||
|
|
||||||
// A Collector is a Prometheus Collector for WMI metrics.
|
|
||||||
type Collector struct {
|
|
||||||
config Config
|
|
||||||
|
|
||||||
// physicalMemoryBytes
|
|
||||||
// Deprecated: Use windows_memory_physical_total_bytes instead
|
|
||||||
physicalMemoryBytes *prometheus.Desc
|
|
||||||
// logicalProcessors
|
|
||||||
// Deprecated: Use windows_cpu_logical_processor instead
|
|
||||||
logicalProcessors *prometheus.Desc
|
|
||||||
// hostname
|
|
||||||
// Deprecated: Use windows_os_hostname instead
|
|
||||||
hostname *prometheus.Desc
|
|
||||||
}
|
|
||||||
|
|
||||||
func New(config *Config) *Collector {
|
|
||||||
if config == nil {
|
|
||||||
config = &ConfigDefaults
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Collector{
|
|
||||||
config: *config,
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
||||||
return &Collector{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) GetName() string {
|
|
||||||
return Name
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Close() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
|
||||||
logger.Warn("The cs collector is deprecated and will be removed in a future release. " +
|
|
||||||
"Logical processors has been moved to cpu_info collector. " +
|
|
||||||
"Physical memory has been moved to memory collector. " +
|
|
||||||
"Hostname has been moved to os collector.")
|
|
||||||
|
|
||||||
c.logicalProcessors = prometheus.NewDesc(
|
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "logical_processors"),
|
|
||||||
"Deprecated: Use windows_cpu_logical_processor instead",
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
)
|
|
||||||
c.physicalMemoryBytes = prometheus.NewDesc(
|
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "physical_memory_bytes"),
|
|
||||||
"Deprecated: Use windows_memory_physical_total_bytes instead",
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
)
|
|
||||||
c.hostname = prometheus.NewDesc(
|
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "hostname"),
|
|
||||||
"Deprecated: Use windows_os_hostname instead",
|
|
||||||
[]string{
|
|
||||||
"hostname",
|
|
||||||
"domain",
|
|
||||||
"fqdn",
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect sends the metric values for each metric
|
|
||||||
// to the provided prometheus Metric channel.
|
|
||||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
|
||||||
// Get systeminfo for number of processors
|
|
||||||
systemInfo := sysinfoapi.GetSystemInfo()
|
|
||||||
|
|
||||||
// Get memory status for physical memory
|
|
||||||
mem, err := sysinfoapi.GlobalMemoryStatusEx()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
|
||||||
c.logicalProcessors,
|
|
||||||
prometheus.GaugeValue,
|
|
||||||
float64(systemInfo.NumberOfProcessors),
|
|
||||||
)
|
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
|
||||||
c.physicalMemoryBytes,
|
|
||||||
prometheus.GaugeValue,
|
|
||||||
float64(mem.TotalPhys),
|
|
||||||
)
|
|
||||||
|
|
||||||
hostname, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSHostname)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
domain, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSDomain)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
fqdn, err := sysinfoapi.GetComputerName(sysinfoapi.ComputerNameDNSFullyQualified)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
|
||||||
c.hostname,
|
|
||||||
prometheus.GaugeValue,
|
|
||||||
1.0,
|
|
||||||
hostname,
|
|
||||||
domain,
|
|
||||||
fqdn,
|
|
||||||
)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
//
|
|
||||||
// Copyright The Prometheus Authors
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
//go:build windows
|
|
||||||
|
|
||||||
package cs_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cs"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/utils/testutils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkCollector(b *testing.B) {
|
|
||||||
testutils.FuncBenchmarkCollector(b, cs.Name, cs.NewWithFlags)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestCollector(t *testing.T) {
|
|
||||||
testutils.TestCollector(t, cs.New, nil)
|
|
||||||
}
|
|
||||||
@@ -35,7 +35,6 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cs"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
||||||
@@ -106,7 +105,6 @@ func NewWithConfig(config Config) *Collection {
|
|||||||
collectors[container.Name] = container.New(&config.Container)
|
collectors[container.Name] = container.New(&config.Container)
|
||||||
collectors[cpu.Name] = cpu.New(&config.CPU)
|
collectors[cpu.Name] = cpu.New(&config.CPU)
|
||||||
collectors[cpu_info.Name] = cpu_info.New(&config.CPUInfo)
|
collectors[cpu_info.Name] = cpu_info.New(&config.CPUInfo)
|
||||||
collectors[cs.Name] = cs.New(&config.Cs)
|
|
||||||
collectors[dfsr.Name] = dfsr.New(&config.DFSR)
|
collectors[dfsr.Name] = dfsr.New(&config.DFSR)
|
||||||
collectors[dhcp.Name] = dhcp.New(&config.Dhcp)
|
collectors[dhcp.Name] = dhcp.New(&config.Dhcp)
|
||||||
collectors[diskdrive.Name] = diskdrive.New(&config.DiskDrive)
|
collectors[diskdrive.Name] = diskdrive.New(&config.DiskDrive)
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cs"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
||||||
@@ -76,7 +75,6 @@ type Config struct {
|
|||||||
Container container.Config `yaml:"container"`
|
Container container.Config `yaml:"container"`
|
||||||
CPU cpu.Config `yaml:"cpu"`
|
CPU cpu.Config `yaml:"cpu"`
|
||||||
CPUInfo cpu_info.Config `yaml:"cpu_info"`
|
CPUInfo cpu_info.Config `yaml:"cpu_info"`
|
||||||
Cs cs.Config `yaml:"cs"`
|
|
||||||
DFSR dfsr.Config `yaml:"dfsr"`
|
DFSR dfsr.Config `yaml:"dfsr"`
|
||||||
Dhcp dhcp.Config `yaml:"dhcp"`
|
Dhcp dhcp.Config `yaml:"dhcp"`
|
||||||
DiskDrive diskdrive.Config `yaml:"diskdrive"`
|
DiskDrive diskdrive.Config `yaml:"diskdrive"`
|
||||||
@@ -131,7 +129,6 @@ var ConfigDefaults = Config{
|
|||||||
Container: container.ConfigDefaults,
|
Container: container.ConfigDefaults,
|
||||||
CPU: cpu.ConfigDefaults,
|
CPU: cpu.ConfigDefaults,
|
||||||
CPUInfo: cpu_info.ConfigDefaults,
|
CPUInfo: cpu_info.ConfigDefaults,
|
||||||
Cs: cs.ConfigDefaults,
|
|
||||||
DFSR: dfsr.ConfigDefaults,
|
DFSR: dfsr.ConfigDefaults,
|
||||||
Dhcp: dhcp.ConfigDefaults,
|
Dhcp: dhcp.ConfigDefaults,
|
||||||
DiskDrive: diskdrive.ConfigDefaults,
|
DiskDrive: diskdrive.ConfigDefaults,
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import (
|
|||||||
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
"github.com/prometheus-community/windows_exporter/internal/collector/container"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
"github.com/prometheus-community/windows_exporter/internal/collector/cpu_info"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/cs"
|
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dfsr"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
"github.com/prometheus-community/windows_exporter/internal/collector/dhcp"
|
||||||
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
"github.com/prometheus-community/windows_exporter/internal/collector/diskdrive"
|
||||||
@@ -87,7 +86,6 @@ var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{
|
|||||||
container.Name: NewBuilderWithFlags(container.NewWithFlags),
|
container.Name: NewBuilderWithFlags(container.NewWithFlags),
|
||||||
cpu.Name: NewBuilderWithFlags(cpu.NewWithFlags),
|
cpu.Name: NewBuilderWithFlags(cpu.NewWithFlags),
|
||||||
cpu_info.Name: NewBuilderWithFlags(cpu_info.NewWithFlags),
|
cpu_info.Name: NewBuilderWithFlags(cpu_info.NewWithFlags),
|
||||||
cs.Name: NewBuilderWithFlags(cs.NewWithFlags),
|
|
||||||
dfsr.Name: NewBuilderWithFlags(dfsr.NewWithFlags),
|
dfsr.Name: NewBuilderWithFlags(dfsr.NewWithFlags),
|
||||||
dhcp.Name: NewBuilderWithFlags(dhcp.NewWithFlags),
|
dhcp.Name: NewBuilderWithFlags(dhcp.NewWithFlags),
|
||||||
diskdrive.Name: NewBuilderWithFlags(diskdrive.NewWithFlags),
|
diskdrive.Name: NewBuilderWithFlags(diskdrive.NewWithFlags),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import (
|
|||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DefaultCollectors = "cpu,cs,memory,logical_disk,physical_disk,net,os,service,system"
|
const DefaultCollectors = "cpu,memory,logical_disk,physical_disk,net,os,service,system"
|
||||||
|
|
||||||
type Collection struct {
|
type Collection struct {
|
||||||
collectors Map
|
collectors Map
|
||||||
|
|||||||
@@ -101,12 +101,6 @@ test_alpha_total 42
|
|||||||
# TYPE windows_cpu_processor_utility_total counter
|
# TYPE windows_cpu_processor_utility_total counter
|
||||||
# HELP windows_cpu_time_total Time that processor spent in different modes (dpc, idle, interrupt, privileged, user)
|
# HELP windows_cpu_time_total Time that processor spent in different modes (dpc, idle, interrupt, privileged, user)
|
||||||
# TYPE windows_cpu_time_total counter
|
# TYPE windows_cpu_time_total counter
|
||||||
# HELP windows_cs_hostname Deprecated: Use windows_os_hostname instead
|
|
||||||
# TYPE windows_cs_hostname gauge
|
|
||||||
# HELP windows_cs_logical_processors Deprecated: Use windows_cpu_logical_processor instead
|
|
||||||
# TYPE windows_cs_logical_processors gauge
|
|
||||||
# HELP windows_cs_physical_memory_bytes Deprecated: Use windows_memory_physical_total_bytes instead
|
|
||||||
# TYPE windows_cs_physical_memory_bytes gauge
|
|
||||||
# HELP windows_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which windows_exporter was built, and the goos and goarch for the build.
|
# HELP windows_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which windows_exporter was built, and the goos and goarch for the build.
|
||||||
# TYPE windows_exporter_build_info gauge
|
# TYPE windows_exporter_build_info gauge
|
||||||
# HELP windows_exporter_collector_duration_seconds windows_exporter: Duration of a collection.
|
# HELP windows_exporter_collector_duration_seconds windows_exporter: Duration of a collection.
|
||||||
@@ -116,7 +110,6 @@ test_alpha_total 42
|
|||||||
windows_exporter_collector_success{collector="cache"} 1
|
windows_exporter_collector_success{collector="cache"} 1
|
||||||
windows_exporter_collector_success{collector="cpu"} 1
|
windows_exporter_collector_success{collector="cpu"} 1
|
||||||
windows_exporter_collector_success{collector="cpu_info"} 1
|
windows_exporter_collector_success{collector="cpu_info"} 1
|
||||||
windows_exporter_collector_success{collector="cs"} 1
|
|
||||||
windows_exporter_collector_success{collector="logical_disk"} 1
|
windows_exporter_collector_success{collector="logical_disk"} 1
|
||||||
windows_exporter_collector_success{collector="memory"} 1
|
windows_exporter_collector_success{collector="memory"} 1
|
||||||
windows_exporter_collector_success{collector="net"} 1
|
windows_exporter_collector_success{collector="net"} 1
|
||||||
@@ -137,7 +130,6 @@ windows_exporter_collector_success{collector="udp"} 1
|
|||||||
windows_exporter_collector_timeout{collector="cache"} 0
|
windows_exporter_collector_timeout{collector="cache"} 0
|
||||||
windows_exporter_collector_timeout{collector="cpu"} 0
|
windows_exporter_collector_timeout{collector="cpu"} 0
|
||||||
windows_exporter_collector_timeout{collector="cpu_info"} 0
|
windows_exporter_collector_timeout{collector="cpu_info"} 0
|
||||||
windows_exporter_collector_timeout{collector="cs"} 0
|
|
||||||
windows_exporter_collector_timeout{collector="logical_disk"} 0
|
windows_exporter_collector_timeout{collector="logical_disk"} 0
|
||||||
windows_exporter_collector_timeout{collector="memory"} 0
|
windows_exporter_collector_timeout{collector="memory"} 0
|
||||||
windows_exporter_collector_timeout{collector="net"} 0
|
windows_exporter_collector_timeout{collector="net"} 0
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ mkdir $textfile_dir | Out-Null
|
|||||||
Copy-Item 'e2e-textfile.prom' -Destination "$($textfile_dir)/e2e-textfile.prom"
|
Copy-Item 'e2e-textfile.prom' -Destination "$($textfile_dir)/e2e-textfile.prom"
|
||||||
|
|
||||||
# Omit dynamic collector information that will change after each run
|
# Omit dynamic collector information that will change after each run
|
||||||
$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_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_performancecounter|windows_performancecounter|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_cache|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_performancecounter|windows_performancecounter|windows_textfile_mtime_seconds)"
|
||||||
|
|
||||||
# Start process in background, awaiting HTTP requests.
|
# Start process in background, awaiting HTTP requests.
|
||||||
# Use default collectors, port and address: http://localhost:9182/metrics
|
# Use default collectors, port and address: http://localhost:9182/metrics
|
||||||
|
|||||||
Reference in New Issue
Block a user