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

Log: Add 'country' to geoip pipeline-stage #5924

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

superstes
Copy link
Contributor

PR Description

Which issue(s) this PR fixes

Maxmind provides multiple GeoIP2 databases.
The three most used ones are City, Country and ASN as they are also available as free GeoLiteIP2 databases.

Some users might want/need to use the 'Country' database - so I added support for it.
A reason: If the user only has the 'Country' database licensed.

Notes to the Reviewer

I've now also added mmdb-specific tests.

To note: The minimal (1 record) testdata-databases are added for the sake of simplicity.

One could also:

  • add the mmdbwriter as (test-)dependency and build those database-binaries at test-runtime from JSON
  • or download the maxmind testdata on each test-run

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2023

CLA assistant check
All committers have signed the CLA.

@superstes
Copy link
Contributor Author

Related to: grafana/loki#11378

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

The doc is OK as-is (consistent with the rest of the topic)

Over to @grafana/grafana-agent-maintainers for a technical review

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Dec 6, 2023
@clayton-cornell clayton-cornell requested a review from a team December 6, 2023 23:39
Copy link
Member

@tpaschalis tpaschalis left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the contribution @superstes and for prioritizing the Agent feature first! 🙌

@tpaschalis tpaschalis enabled auto-merge (squash) December 8, 2023 14:59
@tpaschalis
Copy link
Member

@superstes I can't push to your branch :(

The linter is complaining about the "dummy" and "192.0.2.1" occurences in component/loki/process/stages/geoip_test.go.

Could you please put them in a const to satisfy the linter so we can merge this?

auto-merge was automatically disabled December 9, 2023 20:52

Head branch was pushed to by a user without write access

@superstes
Copy link
Contributor Author

@tpaschalis Sorry - did not mean to block it.
Lint-error should be fixed now.

@clayton-cornell
Copy link
Contributor

@tpaschalis @superstes The build is passing now, so I'll get this one merged :-)

@clayton-cornell clayton-cornell merged commit bb1d64d into grafana:main Dec 14, 2023
10 checks passed
BarunKGP pushed a commit to BarunKGP/grafana-agent that referenced this pull request Feb 20, 2024
* Add 'country' to log pipeline-stage geoip

* Add tests for log pipeline-stage geoip

* Add 'country' to log pipeline-stage geoip

* Lint-fix for tests of pipeline-stage geoip
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants