-
Notifications
You must be signed in to change notification settings - Fork 341
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
koordlet: add external prom metrics collector #1772
koordlet: add external prom metrics collector #1772
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ede8520
to
a4cb357
Compare
462c4fa
to
7445733
Compare
7d8f30d
to
4a4e34f
Compare
if sample.Timestamp.UnixNano() <= 0 { | ||
sample.Timestamp = timeNow | ||
} | ||
if sample.Timestamp.Sub(timeNow) > validTimeRange && sample.Timestamp.Sub(timeNow) < -validTimeRange { |
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.
check the meaning of sample.Timestamp, no need to check if the ts is scrap time
but not origin collect time
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.
scrap time but not origin collect time?
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.
Both are possible. Though many prom exporters do not set the timestamp during collection, some exporters like the cadvisor expose the metrics with collecting timestamp via prometheus.NewMetricWithTimestamp
.
38fd622
to
3c7d3ae
Compare
3c7d3ae
to
b017f8a
Compare
@@ -62,4 +64,16 @@ func (c *Config) InitFlags(fs *flag.FlagSet) { | |||
fs.DurationVar(&c.CPICollectorTimeWindow, "collect-cpi-timewindow", c.CPICollectorTimeWindow, "Collect cpi time window. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).") | |||
fs.DurationVar(&c.ColdPageCollectorInterval, "coldpage-collector-interval", c.ColdPageCollectorInterval, "Collect cold page interval. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h).") | |||
fs.BoolVar(&c.EnablePageCacheCollector, "enable-pagecache-collector", c.EnablePageCacheCollector, "Enable cache collector of node, pods and containers") | |||
fs.StringVar(&c.CollectPromMetricRulePath, "collect-prom-metric-rule-path", c.CollectPromMetricRulePath, "Collect prometheus metrics rule path. The prometheus collector is disabled when the path is empty.") |
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.
leave an issue, consider get metrics rule from koord-manager HTTP API, so that no need to restart koordlet if config changed
if sample.Timestamp.UnixNano() <= 0 { | ||
sample.Timestamp = timeNow | ||
} | ||
if sample.Timestamp.Sub(timeNow) > validTimeRange && sample.Timestamp.Sub(timeNow) < -validTimeRange { |
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.
scrap time but not origin collect time?
Signed-off-by: saintube <saintube@foxmail.com>
b017f8a
to
38bb143
Compare
This issue has been automatically marked as stale because it has not had recent activity.
|
This issue has been automatically closed because it has not had recent activity.
|
Ⅰ. Describe what this PR does
Ⅱ. Does this pull request fix one issue?
fixes #1735.
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews
V. Checklist
make test