-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/windowsperfcountersreceiver] Create common package for windows performance counter receivers #9108
[receiver/windowsperfcountersreceiver] Create common package for windows performance counter receivers #9108
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.
Looks quite good now. A few minor things still.
receiver/windowsperfcountersreceiver/windowsperfcounters_scraper_test.go
Outdated
Show resolved
Hide resolved
receiver/windowsperfcountersreceiver/windowsperfcounters_scraper.go
Outdated
Show resolved
Hide resolved
now := pdata.NewTimestampFromTime(time.Now()) | ||
var errs error | ||
|
||
metrics.EnsureCapacity(len(s.counters)) | ||
|
||
metricSlice.EnsureCapacity(len(s.watchers)) |
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.
There is a problem here that we should address, but it can be a followup PR since it is not a regression.
We should not necessarily return a separate Metric instance for every counter, particularly when multiple counters represent data points that should belong to the same metric.
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 doesn't necessarily make a new metric for every counter. The maximum amount of metrics there could be are the amount of watchers so the capacity is that much.
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.
But it doesn't aggregate data points onto the same metric instance when appropriate, right?
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.
ah yeah, it doesn't when it's generated metrics but does when you define the metric. I'll clean it up in a seperate PR.
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
Description:
Move common code of windows performance counter receiver into separate package to enable building of specific windows technology scrapers without needing to embed the generic windowsperfcounterreceiver into those other receivers.
Link to tracking Issue:
N/A