Skip to content

Commit

Permalink
remove empty description replacement with ifName or index
Browse files Browse the repository at this point in the history
  • Loading branch information
automixer committed Apr 4, 2024
1 parent c26e1a4 commit 4529735
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions pkg/plugins/ocinterfaces/ocifformatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ func (f *ocIfFormatter) ifCounters() []exporter.GMetric {
metric.OperStatus = iface.GetOperStatus().ShortString()
metric.IfType = iface.GetType().ShortString()
metric.LagType = lagType
if desc := iface.GetDescription(); desc == "" {
metric.Description = alias
} else {
metric.Description = desc
}
metric.Description = iface.GetDescription()
// Values
metric.Metric = counterName
metric.Value = counterValue
Expand Down Expand Up @@ -223,11 +219,7 @@ func (f *ocIfFormatter) ifGauges() []exporter.GMetric {
metric.OperStatus = iface.GetOperStatus().ShortString()
metric.IfType = iface.GetType().ShortString()
metric.LagType = lagType
if desc := iface.GetDescription(); desc == "" {
metric.Description = alias
} else {
metric.Description = desc
}
metric.Description = iface.GetDescription()
// Values
metric.Metric = gaugeName
metric.Value = gaugeValue
Expand Down Expand Up @@ -282,11 +274,7 @@ func (f *ocIfFormatter) subIfCounters() []exporter.GMetric {
metric.AdminStatus = subIface.GetAdminStatus().ShortString()
metric.OperStatus = subIface.GetOperStatus().ShortString()
metric.LagType = lagType
if desc := subIface.GetDescription(); desc == "" {
metric.Description = fmt.Sprint(index)
} else {
metric.Description = desc
}
metric.Description = subIface.GetDescription()
// Values
metric.Metric = counterName
metric.Value = counterValue
Expand Down Expand Up @@ -339,11 +327,7 @@ func (f *ocIfFormatter) subIfGauges() []exporter.GMetric {
metric.AdminStatus = subIface.GetAdminStatus().ShortString()
metric.OperStatus = subIface.GetOperStatus().ShortString()
metric.LagType = lagType
if desc := subIface.GetDescription(); desc == "" {
metric.Description = fmt.Sprint(index)
} else {
metric.Description = desc
}
metric.Description = subIface.GetDescription()
// Values
metric.Metric = gaugeName
metric.Value = gaugeValue
Expand Down

0 comments on commit 4529735

Please sign in to comment.