Skip to content

Add source-IP fallback to analytics ignore check - #21

Merged
Gutts-n merged 1 commit into
mainfrom
feat/ignore-by-source-ip
Aug 28, 2026
Merged

Add source-IP fallback to analytics ignore check#21
Gutts-n merged 1 commit into
mainfrom
feat/ignore-by-source-ip

Conversation

@Gutts-n

@Gutts-n Gutts-n commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What changed

Added ANALYTICS_IGNORE_IPS (comma-separated) alongside the existing
ANALYTICS_IGNORE_HEADER / ANALYTICS_IGNORE_VALUES. A request from a
configured IP skips analytics logging the same way a matching header does

  • either check alone is enough, they don't both need to match.

Why

Part of the NESO API-usage-metrics work (neso-nextgen-shared#152). The DXP
frontend (the public-facing NESO data portal, separate from the admin
portal and Data Explorer) still doesn't send an identifying header - that
part of the original ask (neso-nextgen-shared#145) is still open. In the
meantime, the DXP team reported their web server's static egress IPs for
production:
https://github.com/datopian/client-national-grid-shared/issues/496#issuecomment-3158622385
(54.247.74.82, 63.32.18.228).

IP is explicitly a weaker, secondary signal - callable out in #145's
original ask too ("useful, but as a secondary check... an IP-based rule
would need constant maintenance, and when it fell out of date it would
fail silently"). It's a stopgap until the header lands, not a replacement
for it.

Verified

  • pytest - 488 passed.
  • ruff check / mypy - clean.
  • New tests: IP match skips, non-matching IP still records, header and IP
    checks are independent (either alone is sufficient).

Not verified: end-to-end against a live pipeline, and I have no way to
confirm those two IPs are still current from here - production traffic
isn't ingested into the monitoring stack I have access to. Whoever sets
ANALYTICS_IGNORE_IPS should reconfirm with the DXP team first.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: da0442e0-8649-43cb-823e-c15cb0c32733


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Gutts-n
Gutts-n merged commit ea63a5b into main Aug 28, 2026
2 checks passed
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.

1 participant