Page MenuHomePhabricator

NEL logs are missing geoip information
Closed, ResolvedPublic

Description

I believe this is related to T383814: Upgrade eventgate-wikimedia to node20 since the timing pretty much lines up. Current NEL logs (schema /w3c/reportingapi/network_error/1.0.0) in logstash for index w3creportingapi don't have geoip information anymore. NEL dashboard at the time of breakage: https://logstash.wikimedia.org/goto/8b11cf7faba31f31fe703449df7040f2

{
  "_index": "w3creportingapi-default-1-1.0.0-3-2025.10",
  "_id": "itwdYZUB-jfKnJiswTLo",
  "_version": 1,
  "_score": null,
  "_source": {
    "uri_host": "measure-esams.wikimedia.org",
    "tags": [
      "input-kafka-networkerror-eqiad",
      "kafka",
      "throttle-exempt"
    ],
    "type": "network-error",
    "body": {
      "protocol": "h2",
      "status_code": 200,
      "server_ip": "185.15.59.240",
      "sampling_fraction": 1,
      "elapsed_time": 160,
      "method": "GET",
      "type": "ok",
      "phase": "application",
      "referrer": "https://en.wikipedia.org/"
    },
    "@timestamp": "2025-03-04T12:24:54.795Z",
    "age": 15164,
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0",
    "$schema": "/w3c/reportingapi/network_error/1.0.0",
    "meta": {
      "dt": "2025-03-04T12:24:54.741Z",
      "stream": "w3c.reportingapi.network_error",
      "request_id": "433efd09-2d2b-4fdc-8671-0d9ba67a4c57",
      "id": "c9f4cf8f-1ead-4a1b-b738-380382e8f40c"
    },
    "http": {
      "request_headers": {
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0"
      },
      "client_ip": "a.b.c.d"
    },
    "url": "https://measure-esams.wikimedia.org/measure?pulse_identifier=f1a2f5b25c6040b0097c_esams_0&pulse_number=0"
  },
  "fields": {
    "isp_asn": [
      "unknown (unknown)"
    ],
    "meta.dt": [
      "2025-03-04T12:24:54.741Z"
    ],
    "@timestamp": [
      "2025-03-04T12:24:54.795Z"
    ],
    "uri_host": [
      "measure-esams.wikimedia.org"
    ]
  },
  "sort": [
    1741091094795
  ]
}

compare it with an older entry

{
  "_index": "w3creportingapi-default-1-1.0.0-3-2025.09",
  "_id": "npFpV5UBaJATmKuI29-h",
  "_version": 1,
  "_score": null,
  "_source": {
    "tags": [
      "input-kafka-networkerror-codfw",
      "kafka",
      "throttle-exempt"
    ],
    "@timestamp": "2025-03-02T15:11:49.755Z",
    "type": "network-error",
    "$schema": "/w3c/reportingapi/network_error/1.0.0",
    "age": 13824,
    "uri_host": "measure-eqsin.wikimedia.org",
    "http": {
      "client_ip": "a.b.c.d",
      "request_headers": {
        "x-geoip-isp": "Comcast Cable",
        "x-geoip-country": "US",
        "x-geoip-organization": "Comcast Cable",
        "x-geoip-as-number": "7922",
        "x-geoip-subdivision": "FL",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0"
      }
    },
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0",
    "meta": {
      "request_id": "685c9169-91b7-4bd7-95f4-a2b2ebefc578",
      "stream": "w3c.reportingapi.network_error",
      "id": "9d2f4fe7-9733-4470-8b68-031e208c0f60",
      "dt": "2025-03-02T15:11:49.680Z"
    },
    "body": {
      "protocol": "h2",
      "method": "GET",
      "server_ip": "2001:df2:e500:ed1a::2:b",
      "referrer": "https://en.wikipedia.org/",
      "status_code": 200,
      "sampling_fraction": 1,
      "elapsed_time": 259,
      "type": "ok",
      "phase": "application"
    },
    "url": "https://measure-eqsin.wikimedia.org/measure?pulse_identifier=63c6a729a01bc9eadb2c_eqsin_1&pulse_number=1"
  },
  "fields": {
    "isp_asn": [
      "Comcast Cable (7922)"
    ],
    "meta.dt": [
      "2025-03-02T15:11:49.680Z"
    ],
    "@timestamp": [
      "2025-03-02T15:11:49.755Z"
    ],
    "uri_host": [
      "measure-eqsin.wikimedia.org"
    ]
  },
  "sort": [
    1740928309755
  ]
}

The metric disappears at the same time as the deploy:

2025-03-04-132427_1707x1651_scrot.png (1,707×1,651 px, 451 KB)

https://sal.toolforge.org/log/svLoXJUBvg159pQrWDEp 16:48 <otto@deploy2002> helmfile [codfw] DONE helmfile.d/services/eventgate-logging-external: apply [production]

Event Timeline

Joe triaged this task as Unbreak Now! priority.Mar 4 2025, 1:39 PM
Joe subscribed.

Changing to UBN! as per-country NELs are needed for quite a few things, including paging SREs.

Will look into this ASAP today.

I suspect @tchin is correct.

We can also rollback asap if needed.

We can also rollback asap if needed.

Unless you think you have an obvious fix, yes please.

Mentioned in SAL (#wikimedia-operations) [2025-03-04T16:01:15Z] <ottomata> eventgate-logging-external: rolling back to pre node 20 due to bug likely caused by T382173. -- T387850 , T383814

I rolled back. Let's find and fix the bug before deploying again.

@fgiunchedi do you see the headers flowing in now?

I just checked log_w3c_networkerror_by_country_type_doc_count in thanos over the last 2 days, and I don't see the drop off like in the screen shot you posted. Am I looking at the wrong thing?

@fgiunchedi do you see the headers flowing in now?

I just checked log_w3c_networkerror_by_country_type_doc_count in thanos over the last 2 days, and I don't see the drop off like in the screen shot you posted. Am I looking at the wrong thing?

The problem is that there's a missing label.

@fgiunchedi do you see the headers flowing in now?

I just checked log_w3c_networkerror_by_country_type_doc_count in thanos over the last 2 days, and I don't see the drop off like in the screen shot you posted. Am I looking at the wrong thing?

The breakdown by country+type metric is log_w3c_networkerror_by_country_type_country_doc_count whereas log_w3c_networkerror_by_country_type_doc_count is breakdown by type. Anyways the former recovered at 16:05 so we're back!

fgiunchedi lowered the priority of this task from Unbreak Now! to Medium.Mar 4 2025, 5:16 PM

Ah, I read that screen shot metric name like 5 times and thought I had the correct one. Oh well thanks.

Glad it is back. Sorry for the issue! We'll figure it out before deploying again.

Ottomata claimed this task.

Filed T387908 to track the underlying issue.

I'll resolve this one. Please reopen (and raise back to UBN) if this happens again.

Change #1131413 had a related patch set uploaded (by Ottomata; author: Ottomata):

[operations/mediawiki-config@master] EventStreamConfig - keep geoip-* headers in eventgate-logging-external streams

https://gerrit.wikimedia.org/r/1131413

Change #1131413 merged by jenkins-bot:

[operations/mediawiki-config@master] EventStreamConfig - keep geoip-* headers in eventgate-logging-external streams

https://gerrit.wikimedia.org/r/1131413

FYI, I just deployed eventgate-logging-external again. The setting to enable collection of these headers has moved into EventStreamConfig.

I'm watching these events in the kafka logging clusters, and can confirm that the headers are still set as before.

Please reopen if I'm incorrect and something is wrong! Thank you!