-
Notifications
You must be signed in to change notification settings - Fork 92
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
Extract prometheus metrics #1 #256
Conversation
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.
Look good, but not sure if ToJSON
is properly reflecting semantics... Originally the function was created just for readable struct printing...
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'd probably separate Dig and prettyPrint refactoring to different PRs, as they are out of context of this PR
I see, but function accepts interface so can be used to any type. Of course I can limit to structures only, and return error if passed argument is not structure. str{"Foo", 007} =>
{
"Name": "Foo",
"Value": 7
}
123 => "123"
true => "true"
nil => "null" // marshalling implicitly returns this, but can be changed. |
7a83bea
to
d4c9f8b
Compare
@somaritane, amended. |
This is first of PR - move environment variable `POD_NAMESPACE` to `depresolver` - extend depresolver tests - extend depresolver validators for namespace validator - Extract Prometheus metrics into standalone module - Extend prometheus metrics - Fix controller tests - remove dead registry/k3s.yaml file (pushed by mistake) TODO: - dnsupdate refactor to provider pattern in next PR - fianally, some of utils will go into [gopkg](https://github.com/AbsaOSS/gopkg) - IMetrics introduction (#124)
d4c9f8b
to
c761843
Compare
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 👍
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.
looks good
Related to #255
This is the first part of larger refactoring.
moveDig
to utilsmoveprettyPrint()
to utils and rename toToJSON()
coverToJSON()
by testsPOD_NAMESPACE
todepresolver
Register()
,Unregister()
controllers/metrics.go
TODO:
dnsupdate
refactor, to provider pattern, will come in the next PRIMetrics
introduction (should be implemented with Expose advanced metrics #124)