-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: autoresolve ems would export metric value as 0 and autoresolve=true label #2120
Conversation
Hardikl
commented
Jun 1, 2023
![image](https://private-user-images.githubusercontent.com/83282894/242582139-3b8a3124-4832-46a6-bba3-729e45464afe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzA0OTUsIm5iZiI6MTczODk3MDE5NSwicGF0aCI6Ii84MzI4Mjg5NC8yNDI1ODIxMzktM2I4YTMxMjQtNDgzMi00NmE2LWJiYTMtNzI5ZTQ1NDY0YWZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDIzMTYzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjZTkzOTRmNjZkZjg5Yzc2NTM5NzlmYjc5Nzk2YmE5OTRmMDc3MWZmMDExNmE1MzU2NTRhYTc4YmNkZGE5NjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VmiOaVN7O7r2J700RsJbrpbDcjsMDFUGdTnGS3Rqvf8)
We should update the documentation to define the autoresolve label |
Added doc changes for this. |
cmd/collectors/ems/ems.go
Outdated
@@ -41,6 +42,7 @@ type Ems struct { | |||
eventNames []string // consist of all ems events supported | |||
bookendEmsMap map[string]*set.Set // This is reverse bookend ems map, [Resolving ems]:[Set of Issuing ems]. Using Set here to ensure that it has slice of unique issuing ems | |||
resolveAfter map[string]time.Duration // This is resolve after map, [Issuing ems]:[Duration]. After this duration, ems got auto resolved. | |||
autoresolved bool |
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.
How can a single variable autoresolve is handling multiple matrix containing EMS messages? This single var state seems wrong at Collector level. This should be at ems 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.
Now, it's not needed as it would export e.Matrix
with instance exported=true/false and work as expected.
Few corrections:
|
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.
will the logging issues we discussed in earlier meeting be handled in this PR or a different one?
@@ -652,7 +643,16 @@ func (e *Ems) HandleResults(result []gjson.Result, prop map[string][]*emsProp) ( | |||
count += instanceLabelCount | |||
} | |||
} | |||
return m, 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.
Can we calculate instanceCount
in the above loops above, so we don't have to loop through all instances of all matrices again here?
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.
It's added here mainly for autoresolve
case.
In that case, we haven't get any records from ONTAP, so it won't run the above loop, but still we want to export 1 instance which would be resolved based on time.
Logging issue is resolved in this PR at 404-407 lines. |
Matches label counts when multiple ems with same name exist would be handled in next PR |