Skip to content

Geoip heuristic#1074

Open
LDiazN wants to merge 12 commits intomasterfrom
geoip-heuristic
Open

Geoip heuristic#1074
LDiazN wants to merge 12 commits intomasterfrom
geoip-heuristic

Conversation

@LDiazN
Copy link
Contributor

@LDiazN LDiazN commented Feb 5, 2026

This PR implements the geoip mismatch heuristic for faulty measurement detection.

  • Event insertion is done with Clickhouse' asynchronous inserts, to prevent obstructing the main path to the fastpath
  • The table itself is defined to use that type of inserts by default
  • We use a short timeout for completing this query

Closes: #1073
See: #1070

@LDiazN LDiazN requested a review from hellais February 5, 2026 14:14
@LDiazN LDiazN self-assigned this Feb 5, 2026
request: Request,
cc_reader: CCReaderDep,
asn_reader: ASNReaderDep,
clickhouse: Clickhouse
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@aagbsn aagbsn left a comment

Choose a reason for hiding this comment

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

look good, small suggestion to reuse ClickhouseDep

from .metrics import Metrics
from .common.config import Settings
from .common.clickhouse_utils import insert_click
from .dependencies import CCReaderDep, ASNReaderDep
Copy link
Contributor

Choose a reason for hiding this comment

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

ClickhouseDep exists now

Metrics.SEND_FASTPATH_FAILURE.inc()

# wasn't possible to send msmnt to fastpath, try to send it to s3
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

note: if submit to fastpath fails compare_probe_msmt_cc_asn doesn't get called

Copy link
Contributor

@aagbsn aagbsn left a comment

Choose a reason for hiding this comment

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

these changes look good

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.

Register geoip mismatches to clickhouse

2 participants