Skip to content

enhancement(enrichment_tables): Changes to support GeoIP Anonymous IP database#20946

Merged
jszwedko merged 5 commits intovectordotdev:masterfrom
publicfacingusername:enhancement-geoip_anonymousip_db
Jul 27, 2024
Merged

enhancement(enrichment_tables): Changes to support GeoIP Anonymous IP database#20946
jszwedko merged 5 commits intovectordotdev:masterfrom
publicfacingusername:enhancement-geoip_anonymousip_db

Conversation

@publicfacingusername
Copy link
Copy Markdown
Contributor

@publicfacingusername publicfacingusername commented Jul 26, 2024

The following geoip enrichment tables are currently supported:

GeoLite2-ASN
GeoIP2-ISP
GeoIP2-Connection-Type
GeoIP2-City
GeoLite2-City

I'd like to add support for:

GeoIP2-Anonymous-IP

https://dev.maxmind.com/geoip/docs/databases/anonymous-ip

@publicfacingusername publicfacingusername requested a review from a team July 26, 2024 17:32
@publicfacingusername publicfacingusername requested a review from a team as a code owner July 26, 2024 17:32
@bits-bot
Copy link
Copy Markdown

bits-bot commented Jul 26, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the domain: external docs Anything related to Vector's external, public documentation label Jul 26, 2024
@publicfacingusername
Copy link
Copy Markdown
Contributor Author

publicfacingusername commented Jul 26, 2024

See issue: #20945

@publicfacingusername
Copy link
Copy Markdown
Contributor Author

Please note my local test failed. Working on making the appropriate changes then will reset.

error[E0277]: can't compare `std::collections::BTreeMap<KeyString, vector_lib::event::Value>` with `std::collections::BTreeMap<std::string::String, vector_lib::event::Value>`
   --> src/enrichment_tables/geoip.rs:489:9
    |
489 |         assert_eq!(values, expected);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::collections::BTreeMap<KeyString, vector_lib::event::Value> == std::collections::BTreeMap<std::string::String, vector_lib::event::Value>`
    |
    = help: the trait `PartialEq<std::collections::BTreeMap<std::string::String, vector_lib::event::Value>>` is not implemented for `std::collections::BTreeMap<KeyString, vector_lib::event::Value>`
    = help: the following other types implement trait `PartialEq<Rhs>`:
              <std::collections::BTreeMap<K, V, A> as PartialEq>
              <std::collections::BTreeMap<K, V> as PartialEq<rkyv::collections::btree_map::ArchivedBTreeMap<AK, AV>>>
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0004]: non-exhaustive patterns: `DatabaseKind::AnonymousIp` not covered
   --> src/enrichment_tables/geoip.rs:129:28
    |
129 |         let result = match dbkind {
    |                            ^^^^^^ pattern `DatabaseKind::AnonymousIp` not covered
    |
note: `DatabaseKind` defined here
   --> src/enrichment_tables/geoip.rs:24:10
    |
24  | pub enum DatabaseKind {
    |          ^^^^^^^^^^^^
...
29  |     AnonymousIp,
    |     ----------- not covered
    = note: the matched value is of type `DatabaseKind`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
132 ~             DatabaseKind::City => dbreader.lookup::<City>(ip).map(|_| ()),
133 ~             DatabaseKind::AnonymousIp => todo!(),
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `vector` (lib) due to 1 previous error

@jorgehermo9
Copy link
Copy Markdown
Contributor

May you add a changelog fragment too, please? https://github.com/vectordotdev/vector/blob/master/changelog.d/README.md

@publicfacingusername
Copy link
Copy Markdown
Contributor Author

publicfacingusername commented Jul 26, 2024

Testing completed successfully after newly committed changes.

Summary [  90.783s] 2151 tests run: 2151 passed (2 slow, 2 flaky), 11 skipped
   FLAKY 2/4 [   0.120s] vector sources::journald::tests::emits_cursor
   FLAKY 2/4 [   0.123s] vector sources::journald::tests::excludes_matches

@publicfacingusername
Copy link
Copy Markdown
Contributor Author

May you add a changelog fragment too, please? https://github.com/vectordotdev/vector/blob/master/changelog.d/README.md

Done!

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Copy link
Copy Markdown
Collaborator

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

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

Thanks for this @publicfacingusername !

@jszwedko jszwedko enabled auto-merge July 26, 2024 21:20
Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
@jszwedko jszwedko added this pull request to the merge queue Jul 26, 2024
@github-actions
Copy link
Copy Markdown
Contributor

Regression Detector Results

Run ID: af50357e-6195-427e-8fa7-7d5b2b11dba4 Metrics dashboard

Baseline: 4227e96
Comparison: dc50263

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

Significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

perf experiment goal Δ mean % Δ mean % CI links
http_text_to_http_json ingress throughput +5.07 [+4.89, +5.25]

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI links
file_to_blackhole egress throughput +16.60 [+8.91, +24.30]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
file_to_blackhole egress throughput +16.60 [+8.91, +24.30]
http_text_to_http_json ingress throughput +5.07 [+4.89, +5.25]
syslog_log2metric_humio_metrics ingress throughput +4.13 [+4.02, +4.24]
socket_to_socket_blackhole ingress throughput +2.76 [+2.68, +2.84]
otlp_grpc_to_blackhole ingress throughput +2.66 [+2.54, +2.78]
syslog_humio_logs ingress throughput +1.35 [+1.18, +1.51]
datadog_agent_remap_blackhole_acks ingress throughput +0.93 [+0.82, +1.04]
otlp_http_to_blackhole ingress throughput +0.67 [+0.53, +0.80]
splunk_hec_route_s3 ingress throughput +0.18 [-0.13, +0.50]
http_to_http_noack ingress throughput +0.15 [+0.07, +0.23]
http_to_s3 ingress throughput +0.09 [-0.17, +0.35]
http_to_http_json ingress throughput +0.02 [-0.01, +0.05]
splunk_hec_to_splunk_hec_logs_acks ingress throughput +0.00 [-0.12, +0.12]
splunk_hec_to_splunk_hec_logs_noack ingress throughput -0.01 [-0.11, +0.10]
splunk_hec_indexer_ack_blackhole ingress throughput -0.03 [-0.11, +0.06]
fluent_elasticsearch ingress throughput -0.32 [-0.81, +0.17]
datadog_agent_remap_blackhole ingress throughput -0.33 [-0.44, -0.22]
datadog_agent_remap_datadog_logs_acks ingress throughput -0.66 [-0.82, -0.50]
http_to_http_acks ingress throughput -0.75 [-2.07, +0.57]
syslog_splunk_hec_logs ingress throughput -1.08 [-1.17, -0.99]
datadog_agent_remap_datadog_logs ingress throughput -1.16 [-1.35, -0.97]
syslog_regex_logs2metric_ddmetrics ingress throughput -1.48 [-1.63, -1.32]
syslog_log2metric_splunk_hec_metrics ingress throughput -1.69 [-1.80, -1.58]
http_elasticsearch ingress throughput -1.73 [-1.93, -1.54]
syslog_loki ingress throughput -1.78 [-1.86, -1.71]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput -2.57 [-2.66, -2.47]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@github-actions
Copy link
Copy Markdown
Contributor

Regression Detector Results

Run ID: 2b42f793-3bce-4bf4-8a78-e5a4c7b8e144 Metrics dashboard

Baseline: 96de0ac
Comparison: 7f286c4

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

No significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

There were no significant changes in experiment optimization goals at this confidence level and effect size tolerance.

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI links
file_to_blackhole egress throughput -5.96 [-12.63, +0.71]

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
datadog_agent_remap_datadog_logs ingress throughput +3.69 [+3.51, +3.88]
syslog_log2metric_splunk_hec_metrics ingress throughput +2.79 [+2.68, +2.89]
socket_to_socket_blackhole ingress throughput +2.62 [+2.56, +2.69]
http_elasticsearch ingress throughput +2.56 [+2.34, +2.78]
syslog_loki ingress throughput +2.31 [+2.21, +2.41]
syslog_regex_logs2metric_ddmetrics ingress throughput +2.09 [+1.94, +2.24]
otlp_http_to_blackhole ingress throughput +1.88 [+1.73, +2.03]
http_text_to_http_json ingress throughput +1.00 [+0.87, +1.14]
otlp_grpc_to_blackhole ingress throughput +0.51 [+0.40, +0.63]
http_to_http_acks ingress throughput +0.40 [-0.92, +1.72]
datadog_agent_remap_blackhole_acks ingress throughput +0.31 [+0.22, +0.40]
http_to_http_noack ingress throughput +0.17 [+0.09, +0.26]
syslog_log2metric_humio_metrics ingress throughput +0.14 [+0.00, +0.29]
http_to_http_json ingress throughput +0.04 [+0.00, +0.08]
http_to_s3 ingress throughput +0.02 [-0.24, +0.29]
splunk_hec_indexer_ack_blackhole ingress throughput +0.01 [-0.07, +0.09]
splunk_hec_to_splunk_hec_logs_noack ingress throughput +0.01 [-0.09, +0.11]
splunk_hec_to_splunk_hec_logs_acks ingress throughput -0.00 [-0.15, +0.14]
datadog_agent_remap_datadog_logs_acks ingress throughput -0.31 [-0.49, -0.13]
fluent_elasticsearch ingress throughput -0.33 [-0.82, +0.17]
syslog_log2metric_tag_cardinality_limit_blackhole ingress throughput -0.44 [-0.55, -0.34]
syslog_humio_logs ingress throughput -0.81 [-0.97, -0.65]
splunk_hec_route_s3 ingress throughput -0.90 [-1.22, -0.58]
datadog_agent_remap_blackhole ingress throughput -1.00 [-1.11, -0.88]
syslog_splunk_hec_logs ingress throughput -1.00 [-1.10, -0.90]
file_to_blackhole egress throughput -5.96 [-12.63, +0.71]

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

Merged via the queue into vectordotdev:master with commit 7f286c4 Jul 27, 2024
ym pushed a commit to ym/vector that referenced this pull request Aug 18, 2024
… database (vectordotdev#20946)

* Adding files to support Anonymous IP database

* Addressing bugs discovered in testing

* Adding changelog fragment

* spellcheck

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* cargo fmt

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

---------

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Co-authored-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
AndrooTheChen pushed a commit to discord/vector that referenced this pull request Sep 23, 2024
… database (vectordotdev#20946)

* Adding files to support Anonymous IP database

* Addressing bugs discovered in testing

* Adding changelog fragment

* spellcheck

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

* cargo fmt

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>

---------

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Co-authored-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants