-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
The Collector™ #148
The Collector™ #148
Conversation
pkg/collector/collector.go
Outdated
} | ||
|
||
// do we know this check instance? | ||
if _, found := c.checks[id]; !found { |
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 should we not exist but just create the new check instead even if i wasn't running before ?
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.
So this is tricky b/c we could but at the moment we can't easily because the Loaders (that we need to try to create the right type of check) expect a different configuration format. But yeah, we should make checks creation simpler and take this into consideration, will add a TODO for now
} | ||
|
||
// ReloadCheck stops and restart a check with a new configuration | ||
func (c *Collector) ReloadCheck(id check.ID, config, initConfig check.ConfigData) 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.
can we extract a StopCheck(id check.ID)
method from this? Service discovery will need it
b958000
to
6866369
Compare
ad40c74
to
3925be0
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
Add `ports` options to all Agent containers
What does this PR do?
Adds a new component called
Collector
that wraps the common operations needed to start collecting data from checks. TheCollector
beside wrapping some code is responsible to keep the list of "active" check instances.To simplify the code and the API,
scheduler.Cancel
andrunner.StopCheck
were made noops in case the check is not there.Motivation
Having a clean and consistent API to interact with check instances, something the Service Discovery will heavily rely on.