Skip to content
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

[receivers/mongodbatlasrecevier] fix first scrape lookback time #8246

Merged
merged 4 commits into from
Mar 10, 2022

Conversation

mstumpfx
Copy link

@mstumpfx mstumpfx commented Mar 2, 2022

Description: The first start lookback was being set to the 0 value of time.Time, and ultimately being passed to the mongodb atlas api with a value of 0001-01-01T00:00:00Z, which is bad. Results in an attempt to query a large amount of data.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test to verify the behavior?

@mstumpfx
Copy link
Author

mstumpfx commented Mar 9, 2022

Can you add a unit test to verify the behavior?

@anuraaga I added a attempted to split out the functionality to make it easier to test, and added receiver_test.go with a unit test for it.

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit. otherwise LGTM

receiver/mongodbatlasreceiver/receiver_test.go Outdated Show resolved Hide resolved
@jpkrohling jpkrohling enabled auto-merge (squash) March 10, 2022 11:50
@jpkrohling jpkrohling merged commit 3c3b149 into open-telemetry:main Mar 10, 2022
@mstumpfx mstumpfx deleted the mdb-atlas branch March 10, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants