NIC collector return error:"xxx label:<name:xxx> counter:<value:0>was collected before with the same name and label values"
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!
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?
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.

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

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"?
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'.
Same problem here, 2 virtual interfaces with same name, collector not working
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!
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.