windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

NIC collector return error:"xxx label:<name:xxx> counter:<value:0>was collected before with the same name and label values"

Open david1024wu opened this issue 5 years ago • 6 comments

Hello: Some of my physical servers recently returned an error when accessing a http://ipaddress:9182

An error has occurred during metrics gathering:

48 error(s) occurred:
* collected metric wmi_net_bytes_received_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_bytes_sent_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_bytes_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_outbound_discarded label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_outbound_errors label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_discarded label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_errors label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_unknown label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_sent_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_current_bandwidth label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet" > gauge:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_bytes_received_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_bytes_sent_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_bytes_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_outbound_discarded label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_outbound_errors label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_discarded label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_errors label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_received_unknown label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_packets_sent_total label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > counter:<value:0 >  was collected before with the same name and label values
* collected metric wmi_net_current_bandwidth label:<name:"nic" value:"Broadcom_NetXtreme_Gigabit_Ethernet__2" > gauge:<value:0 >  was collected before with the same name and label values
......

OS:Windows server 2008 R2 wmi_exporter version:After this problem occurred, I tried to install 0.9.0 and 0.11.1 on these servers,but nothing improved. ENABLED_COLLECTORS="cpu,cs,logical_disk,logon,memory,net,os,service,system,tcp,textfile"

Is there any way to solve this problem? Thanks!

david1024wu avatar Jul 22 '20 08:07 david1024wu

Hi @david1024wu, Looks like you have multiple interfaces with the same name, or names that end up the same after the sanitizing pass we do (replacing everything that isn't a-z or 0-9 with _). If you check in perfmon, what instances do you have of the Network Interface counters?

carlpett avatar Jul 26 '20 06:07 carlpett

Hi carlpett,Thank you for your comment. I checked the perfmon,the instances of the network interface counters don't seem to have the same name. image

But in cmd run:wmic nic list brief,There are NICs and they have the same name. image

david1024wu avatar Jul 30 '20 08:07 david1024wu

I have the same problem. My physical server is an HP Proliant ML350pGen8.

There are 4 NICs. Under "Control Panel", "Network and Internet", "Network Connections", they are:  Name: "Ethernet", "Ethernet 2", "Ethernet 3", "Ethernet 4".  Device Name: all 4 are "HP Ethernet 1Gb 4-port 331i Adapter" I can rename them, but only the "Ethernet X" name, not the "Device Name".

Command "wmic nic list brief" lists (among other NICs):

AdapterType DeviceID MACAddress Name ServiceName Ethernet 802.3 10 xx:xx:xx:xx:xx:DA HP Ethernet 1Gb 4-port 331i Adapter q57nd60a Ethernet 802.3 11 (redacted out):D9 HP Ethernet 1Gb 4-port 331i Adapter q57nd60a Ethernet 802.3 12 (redacted out):D8 HP Ethernet 1Gb 4-port 331i Adapter q57nd60a Ethernet 802.3 13 (redacted out):DB HP Ethernet 1Gb 4-port 331i Adapter q57nd60a

All Windows Exporter errors are like this one:

collected metric "windows_net_bytes_received_total" { label:<name:"nic" value:"HP_Ethernet_1Gb_4_port_331i_Adapter" > counter:<value:1.80533694e+08 > } was collected before with the same name and label values

I am no Windows expert, but is that "Name" or "Device Name" required to be unique? Shouldn't the Windows Exporter be using the "DeviceID"?

rdiez avatar Nov 08 '21 15:11 rdiez

As a workaround, I tried blacklisting the common NIC name, but this had no effect:

msiexec /passive /i windows_exporter-0.16.0-amd64.msi EXTRA_FLAGS="--collector.net.nic-blacklist HP_Ethernet_1Gb_4_port_331i_Adapter"

So I had to disable the entire 'net' collector like this:

msiexec /passive /i windows_exporter-0.16.0-amd64.msi ENABLED_COLLECTORS=cpu,cs,logical_disk,os,service,system,textfile

I could not find a way to disable a single collector, so I manually added those documented as "Enabled by default", except for 'net'.

rdiez avatar Nov 08 '21 16:11 rdiez

Same problem here, 2 virtual interfaces with same name, collector not working

skpenpen avatar May 30 '22 09:05 skpenpen

The Perflib source used by the collector doesn't expose a device ID. We could add a second source (WMI for example) and enable it with a collector flag.

Happy to review any PRs for this!

breed808 avatar Jun 19 '22 08:06 breed808

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

github-actions[bot] avatar Nov 25 '23 05:11 github-actions[bot]