-
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/mongodbatlas] Refactored to use New metric builder #9093
[receiver/mongodbatlas] Refactored to use New metric builder #9093
Conversation
@zenmoto Would you mind giving a review since you are codeowner? |
receiver/mongodbatlasreceiver/internal/metadata/metric_name_mapping.go
Outdated
Show resolved
Hide resolved
That is a dramatic improvement. |
a37a455
to
8753c7f
Compare
8753c7f
to
7510181
Compare
Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>
7510181
to
44d0f50
Compare
@dmitryax Can I get a re-review on this please? |
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.
Sorry for the late response
|
||
return &m, nil | ||
func MeasurementsToMetric(mb *MetricsBuilder, meas *mongodbatlas.Measurements, buildUnrecognized bool) error { | ||
recordFunc := getRecordFunc(meas.Name) |
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.
My idea for the switch case was to avoid passing functions. Something like this:
for _, point := range meas.DataPoints {
if point.Value != nil {
curTime, err := time.Parse(time.RFC3339, point.Timestamp)
if err != nil {
return err
}
record(mb, meas, point, curTime)
}
}
And inside record
we use switch case to make particular call.
Not needed for this PR tho. Can be done separately.
Description: Used latest version of mdatagen on
mongodbatlas
receiver and updated scraper code to utilize generated structures while trying to leave the majority of code intact where possible.Not all metric and resource attributes where captures in the
metadata.yaml
so I updated that. I also renamed some resource attributes so they are all prefixed withmongodb_atlas
where before only some where.Link to tracking Issue:
Resolves #7145
Resolves #8831
Testing: Current tests still pass. Manually compared results against previous results before change and matches according (minus some resource property name changes)
Documentation: Generated metric docs have changed.