elastic / synthetics

Synthetic Monitoring with Real Browsers
MIT License
66 stars 41 forks source link

Network data seems to be missing in case of timeout of page.goto #647

Closed shahzad31 closed 1 year ago

shahzad31 commented 2 years ago

Since page. goto is timing out, this breaks network timings waterfall, not sure if this is a bug or expected behaviour

image image
vigneshshanmugam commented 2 years ago

I have done bunch of tests with 301 and custom redirects as per the above scenario. But unable to reproduce with some of the tests I have done, Would be helpful if you can share the journey/network_info documents associated with it.

The puzzling thing is the timeline of the waterfall itself. In any case, we should have seen the timeout of the redirects in the range of 30000ms not `50ms. I will wait for the network documents before coming to any conclusion.

shahzad31 commented 1 year ago

@vigneshshanmugam only one request has timing data, which ends up settings the domains of the chart

{
        "_index": ".ds-synthetics-browser.network-default-2022.11.29-000018",
        "_id": "gsn5woQBDQtf7pR5eEoh",
        "_score": 0,
        "_source": {
          "agent": {
            "name": "cron-b59ee2ad79c56c88-27828640-bhn4p",
            "id": "33c77bee-86a3-433d-bb91-6512df19c060",
            "type": "heartbeat",
            "ephemeral_id": "d13218ea-312c-4171-8a71-28b7e9f893a7",
            "version": "8.5.0"
          },
          "package": {
            "name": "@elastic/synthetics",
            "version": "1.0.0-beta.37"
          },
          "os": {
            "platform": "linux"
          },
          "synthetics": {
            "package_version": "1.0.0-beta.37",
            "journey": {
              "name": "inline",
              "id": "inline"
            },
            "payload": {
              "is_navigation_request": true,
              "response_received_time": 1669718403.8896244,
              "browser": {
                "name": "HeadlessChrome",
                "version": "106.0.5249.30"
              },
              "timings": {
                "receive": 52.533,
                "wait": 23.06,
                "total": 103.667,
                "blocked": 1.049,
                "dns": 16.96,
                "ssl": 8.575,
                "send": 0,
                "connect": 10.065
              },
              "request_sent_time": 1669718403.7836168,
              "type": "document",
              "load_end_time": 1669718403.8992581
            },
            "index": 2,
            "step": {
              "duration": {
                "us": 0
              },
              "name": "Go to https://elastic.co",
              "index": 1,
              "status": ""
            },
            "type": "journey/network_info"
          },
          "monitor": {
            "origin": "ui",
            "name": "https://elastic.co",
            "check_group": "2d3a1872-6fd2-11ed-a079-06bac9141edf",
            "id": "b51e6216-6be7-4a7f-af6c-dca297c912bf",
            "timespan": {
              "lt": "2022-11-29T10:50:38.799Z",
              "gte": "2022-11-29T10:40:38.799Z"
            },
            "type": "browser"
          },
          "url": {
            "path": "/",
            "scheme": "https",
            "port": 443,
            "domain": "elastic.co",
            "full": "https://elastic.co/"
          },
          "tags": [
            "dev",
            "staging",
            "prod",
            "test",
            "qa"
          ],
          "observer": {
            "geo": {
              "name": "North America - US Central",
              "location": "41.8780, 93.0977"
            },
            "name": "North America - US Central"
          },
          "@timestamp": "2022-11-29T10:40:03.783Z",
          "ecs": {
            "version": "8.0.0"
          },
          "config_id": "b51e6216-6be7-4a7f-af6c-dca297c912bf",
          "data_stream": {
            "namespace": "default",
            "type": "synthetics",
            "dataset": "browser.network"
          },
          "http": {
            "request": {
              "headers": {
                "path": "/",
                "method": "GET",
                "scheme": "https",
                "authority": "elastic.co",
                "sec_fetch_mode": "navigate",
                "accept_encoding": "gzip, deflate, br",
                "sec_fetch_site": "none",
                "sec_fetch_user": "?1",
                "upgrade_insecure_requests": "1",
                "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/106.0.5249.30 Safari/537.36 Elastic/Synthetics",
                "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                "sec_fetch_dest": "document"
              },
              "method": "GET",
              "bytes": 531,
              "body": {
                "bytes": 0
              },
              "url": "https://elastic.co/"
            },
            "response": {
              "headers": {
                "date": "Tue, 29 Nov 2022 10:34:13 GMT",
                "strict_transport_security": "max-age=31536000; includeSubDomains",
                "cache_control": "public, max-age=3200",
                "location": "https://www.elastic.co/",
                "alt_svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
                "content_length": "0",
                "age": "350",
                "via": "1.1 google"
              },
              "mime_type": "x-unknown",
              "bytes": 0,
              "remote_port": 443,
              "remote_i_p_address": "34.107.161.234",
              "status_text": "",
              "security_details": {
                "protocol": "TLS 1.3",
                "valid_to": 1673281058,
                "subject_name": "artifacts-no-kpi.elastic.co",
                "valid_from": 1665505059,
                "issuer": "GTS CA 1D4"
              },
              "body": {
                "bytes": 0
              },
              "redirect_u_r_l": "https://www.elastic.co/",
              "url": "https://elastic.co/",
              "status": 301
            }
          },
          "tls": {
            "server": {
              "x509": {
                "not_after": "2023-01-09T16:17:38.000Z",
                "not_before": "2022-10-11T16:17:39.000Z",
                "subject": {
                  "common_name": "artifacts-no-kpi.elastic.co"
                },
                "issuer": {
                  "common_name": "GTS CA 1D4"
                }
              }
            },
            "version": "1.3",
            "version_protocol": "tls"
          },
          "event": {
            "agent_id_status": "auth_metadata_missing",
            "ingested": "2022-11-29T10:40:39Z",
            "type": "journey/network_info",
            "dataset": "browser.network"
          },
          "user_agent": {
            "name": "HeadlessChrome",
            "version": "106.0.5249.30"
          }
        }
      },
vigneshshanmugam commented 1 year ago

@shahzad31 Yeah that is correct. So it does seem that this is indeed correct.

All of the inflight requests that is not getting finished - Loading Completed/ Loading Failed will not get any associated resource timing data which is why all of them are blank.

I did test with a dummy page setting the timeout to minimal and was able to see the data in the waterfall without any network info. Unfortunately there is not much we can do about it as browsers does not expose the resource timing info for the inflight requests.

Closing the issue as its expected behaviour.