@cryptotaxi247 / netdata-1 / commits / 3260791d1

remove devType/Vendor/ from ddsnmp metric families (#20585)

Ilya Mashchenko committed Jun 26, 2025 at 23:21 UTC 3260791d1ed8461203c13586ba6e77b70b6f6d79
1 file changed -29
src/go/plugin/go.d/collector/snmp/ddsnmp/ddsnmpcollector/collector.go
-29
@@ -139,35 +139,6 @@ func (c *Collector) collectProfile(ps *profileState) (*ddsnmp.ProfileMetrics, er
139 }
140
141 func (c *Collector) updateMetrics(pms []*ddsnmp.ProfileMetrics) {
142 - // Find device vendor and type from any profile that has them.
143 - // Multiple profiles can be loaded for a single device (e.g., base profiles, generic MIB profiles),
144 - // but only device-specific profiles contain vendor/type information.
145 - // We need to apply vendor/type to ALL metrics across ALL profiles to ensure consistent
146 - // metric family naming (e.g., "interface/stats" → "router/cisco/interface/stats").
147 - for _, ps := range c.profiles {
148 - if !ps.initialized {
149 - continue
150 - }
151 - if ps.profile.Definition == nil {
152 - continue
153 - }
154 - res, ok := ps.profile.Definition.Metadata["device"]
155 - if !ok {
156 - continue
157 - }
158 - dt, dv := res.Fields["type"].Value, res.Fields["vendor"].Value
159 - if dt == "" || dv == "" {
160 - continue
161 - }
162 - for _, pm := range pms {
163 - for i := range pm.Metrics {
164 - m := &pm.Metrics[i]
165 - m.Family = processMetricFamily(m.Family, dt, dv)
166 - }
167 - }
168 - break
169 - }
170 -
142 for _, pm := range pms {
143 for i := range pm.Metrics {
144 m := &pm.Metrics[i]