add missing pem metrics for qfx5220 and ex4300#9
Open
surprise30 wants to merge 8 commits intomainfrom
Open
Conversation
taktv6
requested changes
Mar 6, 2026
| func (c *environmentCollector) Collect(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { | ||
| c.environmentItems(client, ch, labelValues) | ||
| c.environmentPEMItems(client, ch, labelValues) | ||
| var v showVersionResult |
There was a problem hiding this comment.
Please extract version determination into a separate function. I'm wondering if no other place exists, that needs this already?
Collaborator
Author
| } | ||
|
|
||
| func (c *environmentCollector) environmentItemsQFX5220(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { | ||
| x := environmentResultQFX5220{} |
There was a problem hiding this comment.
Please come up with a better variable name.
Collaborator
Author
There was a problem hiding this comment.
Added the work Model to the variable name.
Original struct for the feature is called "multiEngineResult" so I am trying to follow this pattern
| func (c *environmentCollector) environmentPEMItemsQFX5220(client collector.Client, ch chan<- prometheus.Metric, labelValues []string) error { | ||
| x := environmentPEMResultQFX5220{} | ||
|
|
||
| stateValues := map[string]int{ |
| if err != nil { | ||
| return errors.Wrap(err, "failed to run command 'show version'") | ||
| } | ||
| // QFX5220 and EX4300 have a slightly different xml for environment information, so we need to check the product model before collecting environment metrics |
There was a problem hiding this comment.
I'm really wondering if this is not an QFX vs. EX general thing. Unfortunately we don't have access to other EX and QFX models. Well, at least we have QFX5110! Please double check!
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.