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

[processor/geoip] Add maxmind geoprovider #33451

Merged
merged 22 commits into from
Jun 27, 2024

Conversation

rogercoll
Copy link
Contributor

@rogercoll rogercoll commented Jun 10, 2024

Description: This PR adds an initial implementation for the MaxMind GeoIP provider for later usage in the geoipprocessor. The processor is still a nop, as no provider can be configured yet. Providers configuration will be added in #33268.

Link to tracking Issue: #32663

Testing: Database files are generated before running the unit tests using MaxMind writer.. The generation time of those files seems not to be an issue (0.189s):

$ go test -v
=== RUN   TestInvalidNewProvider
--- PASS: TestInvalidNewProvider (0.00s)
=== RUN   TestProviderLocation
=== PAUSE TestProviderLocation
=== CONT  TestProviderLocation
=== RUN   TestProviderLocation/nil_IP_address
=== RUN   TestProviderLocation/unsupported_database_type
=== RUN   TestProviderLocation/no_IP_metadata_in_database
=== RUN   TestProviderLocation/all_attributes_should_be_present_for_IPv4_using_GeoLite2-City_database
=== RUN   TestProviderLocation/subset_attributes_for_IPv6_IP_using_GeoIP2-City_database
--- PASS: TestProviderLocation (0.00s)
    --- PASS: TestProviderLocation/nil_IP_address (0.00s)
    --- PASS: TestProviderLocation/unsupported_database_type (0.00s)
    --- PASS: TestProviderLocation/no_IP_metadata_in_database (0.00s)
    --- PASS: TestProviderLocation/all_attributes_should_be_present_for_IPv4_using_GeoLite2-City_database (0.00s)
    --- PASS: TestProviderLocation/subset_attributes_for_IPv6_IP_using_GeoIP2-City_database (0.00s)
PASS
ok  	github.com/open-telemetry/opentelemetry-collector-contrib/processor/geoipprocessor/internal/provider/maxmindprovider	0.189s

Testing database files are removed on sucessful test execution.

Documentation: README.md file

require (
github.com/maxmind/mmdbwriter v1.0.0 // indirect
go4.org/netipx v0.0.0-20230824141953-6213f710f925 // indirect
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this a separate set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure, it was automatically added by my editor's formatter (maybe when working from a go.mod subdirectory?). Require blocks unified in 05458bf

@rogercoll
Copy link
Contributor Author

@andrzej-stencel @fatsheep9146

I wanted to check in regarding this PR. If there’s anything specific you need from me before reviewing, please let me know.

Thank you in advance!

@andrzej-stencel andrzej-stencel merged commit 2c94519 into open-telemetry:main Jun 27, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 27, 2024
@rogercoll rogercoll deleted the add_maxmind_geoprovider branch June 27, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants