-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Net 818 #3
Net 818 #3
Conversation
pkg/features/isis/collector.go
Outdated
@@ -77,6 +83,12 @@ func (c *isisCollector) Collect(client collector.Client, ch chan<- prometheus.Me | |||
} | |||
} | |||
|
|||
var i interfaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
is to be used for an int loop invariant. Would suggest ifas
as short form of interfaces
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/features/isis/collector.go
Outdated
} | ||
labels := append(labelValues, | ||
i.InterfaceName, | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, created new lables for this metric
pkg/features/isis/collector.go
Outdated
i.InterfaceLevelData.Level) | ||
c, err := strconv.Atoi(i.InterfaceLevelData.AdjacencyCount) | ||
if err != nil { | ||
log.Errorf("unable to convert number of adjanceis: %q", i.InterfaceLevelData.AdjacencyCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to succeed after logging the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/features/isis/rpc.go
Outdated
IsisInterface []struct { | ||
InterfaceName string `xml:"interface-name"` | ||
InterfaceLevelData struct { | ||
Level string `xml:"level"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an int?
pkg/features/isis/rpc.go
Outdated
InterfaceName string `xml:"interface-name"` | ||
InterfaceLevelData struct { | ||
Level string `xml:"level"` | ||
AdjacencyCount string `xml:"adjacency-count"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int?
pkg/features/isis/collector.go
Outdated
adjState = prometheus.NewDesc(prefix+"adjacency_state", "The ISIS Adjacency state (0 = DOWN, 1 = UP, 2 = NEW, 3 = ONE-WAY, 4 =INITIALIZING , 5 = REJECTED)", l, nil) | ||
lablesForInterfaceMetrics := []string{"target", "interface_name", "level"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to interfaceMetricsLabels
?
pkg/features/isis/collector.go
Outdated
upCount *prometheus.Desc | ||
totalCount *prometheus.Desc | ||
adjState *prometheus.Desc | ||
upCount *prometheus.Desc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be so kind and suffix them all with Desc
.
pkg/features/isis/collector.go
Outdated
@@ -3,26 +3,32 @@ | |||
package isis | |||
|
|||
import ( | |||
"github.com/pkg/errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports should be sorted:
- standard library
- project internal packages
- project external packages
- renamed packages (first internal, then external)
pkg/features/isis/collector.go
Outdated
totalCountDesc = prometheus.NewDesc(prefix+"total_count", "Number of ISIS Adjacencies", l, nil) | ||
l = append(l, "interface_name") | ||
LSPIntervalDesc = prometheus.NewDesc(prefix+"lsp_interval", "The ISIS LSP interval", l, nil) | ||
CNMPIntervalDesc = prometheus.NewDesc(prefix+"cnmp_interval", "The ISIS CNMP interval", l, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSNP interval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general. Just not happy with that one name.
pkg/features/isis/collector.go
Outdated
} | ||
} | ||
|
||
func (*isisCollector) additionalIsIsInterfaceMetrics(ifas interfaces, ch chan<- prometheus.Metric, labelValues []string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method name is not really saying too precisely what it does. Either we group things so that we can find a common precise term or we merge this into isisInterfaces
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* added a feature for macsec * small refactoring of some functions * added support for fec mode to interfaces plugin * small edits * small edits * small edits + chamged the mtu metric name * removed unnecessary string clean-up * small fixes as per pull request * tiny editing * Net 818 (#3) * adding number of isis adanceis per interface. Saving progress * finished * saving * saving * fixed some issues from pull request * fixes from merge request * added small fixes from pull review * added four new metrics for isis * added additional ISIS metrics * sorted imports * applied fixes from MR * small edit * small re-org * small re-org --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com>
* added a feature for macsec * small refactoring of some functions * added support for fec mode to interfaces plugin * small edits * small edits * small edits + chamged the mtu metric name * removed unnecessary string clean-up * small fixes as per pull request * tiny editing * Net 818 (#3) * adding number of isis adanceis per interface. Saving progress * finished * saving * saving * fixed some issues from pull request * fixes from merge request * added small fixes from pull review * added four new metrics for isis * added additional ISIS metrics * sorted imports * applied fixes from MR * small edit * small re-org * small re-org --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> * Add ARP feature (#4) * init config for arp feature * small fix of type and added tests * small changes in test file * reduced the test xml * small edit in test file * small edits * turned off isis --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> Co-authored-by: Daniel Brendgen-Czerwonk <czerwonk@users.noreply.github.com>
* added a feature for macsec * small refactoring of some functions * added support for fec mode to interfaces plugin * small edits * small edits * small edits + chamged the mtu metric name * removed unnecessary string clean-up * small fixes as per pull request * tiny editing * Net 818 (#3) * adding number of isis adanceis per interface. Saving progress * finished * saving * saving * fixed some issues from pull request * fixes from merge request * added small fixes from pull review * added four new metrics for isis * added additional ISIS metrics * sorted imports * applied fixes from MR * small edit * small re-org * small re-org --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> * Add ARP feature (#4) * init config for arp feature * small fix of type and added tests * small changes in test file * reduced the test xml * small edit in test file * small edits * turned off isis --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> --------- Co-authored-by: Vincent Vilenchik <vincent.vilenchik@deepl.com> Co-authored-by: Daniel Brendgen-Czerwonk <czerwonk@users.noreply.github.com>
Added support to report amount of adjancies to every interface which is enabled for ISIS ( excluding passive)