sitespeed.io: Unable to send to graphite

Hey guys,

I’ve setup my sitespeed with graphite and grafana and im trying to send the data to graphite and getting a look up error. Its quite odd.

platform: linux
image_resource:
  type: docker-image
  source:
    repository: sitespeedio/sitespeed.io
    aws_access_key_id: ((aws-access-key-id))
    aws_secret_access_key: ((aws-secret-access-key))
caches:
  - path: root/.npm
inputs:
  - name: source-code
run:
  dir: source-code/test/perf
  user: root
  path: sh
  args:
  - -xce
  - |

    GRAPHITE_HOST=https://graphite-us-central1.grafana.net/metrics
    GRAPHITE_USER=username
    GRAPHITE_ACCESS_KEY=password

    npm i
    /usr/src/app/docker/scripts/start.sh --graphite.host $GRAPHITE_HOST --graphite.port 2003 --graphite.auth $GRAPHITE_USER:$GRAPHITE_ACCESS_KEY --graphite.namespace performance.test ../../test/perf/perf-test.js --multi --spa --video false --browsertime.iterations 1 --browsertime.skipHar --browsertime.cacheClearRaw

The tests run fine but when it trys to send to graphite i get:

Google Chrome 79.0.3945.79 
Mozilla Firefox 71.0
[2020-02-24 20:25:50] INFO: Running tests using Chrome - 1 iteration(s)
[2020-02-24 20:26:11] INFO: Start to measure login
[2020-02-24 20:26:12] INFO: Logging in...
[2020-02-24 20:26:14] INFO: Logged in, delay: 2.27 sec
[2020-02-24 20:27:20] WARN: BrowserError: Failed to take screenshot
    at SeleniumRunner.takeScreenshot (/usr/src/app/node_modules/browsertime/lib/core/seleniumRunner.js:259:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
[2020-02-24 20:27:20] INFO: Login measured
[2020-02-24 20:27:28] ERROR: Error: getaddrinfo ENOTFOUND https://graphite-us-central1.grafana.net/metrics
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
[2020-02-24 20:27:28] ERROR: Error: getaddrinfo ENOTFOUND https://graphite-us-central1.grafana.net/metrics
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
[2020-02-24 20:27:28] ERROR: Error: getaddrinfo ENOTFOUND https://graphite-us-central1.grafana.net/metrics
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
[2020-02-24 20:27:28] ERROR: Error: getaddrinfo ENOTFOUND https://graphite-us-central1.grafana.net/metrics
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
[2020-02-24 20:27:31] INFO: HTML stored in /tmp/build/e55deab7/source-code/test/perf/sitespeed-result/perf-test_js/2020-02-24-20-25-50
failed

I believe this could be user error and i’ve made a mistake somewhere in configuring. Any help or assistance would be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Hi @soulgalore thought id give an update. I got it posting to graphite, not sure if this is the recommended way so thought id share if someone else has had the trouble iv had. I was unable to get it working with the config options so im manually posting with wget.

I had trouble finding the start script for the sitespeedio/browsertime or sitespeedio/sitespeed.io docker images so maybe that could be easier for folks. Also noticed sitespeed is creating a folder based on the path so it was important to use the --resultDir so i didn’t get a folder name like ‘.-test-perf-my-test.js’ coz thats a bad folder name haha. Also alot of this is new for me so sorry If I’m not doing it correctly ☮️ Appreciate the support

sudo apt-get install jq -y

# Generating Report
/usr/src/app/docker/scripts/start.sh ./test/perf/sitespeed.js --browser "chrome" --resultDir report --skipHar true --iterations 1 --prettyPrint true --video false --visualMetrics false
      
PERF_REPORT=$(cat ./report/browsertime.json | jq '.[0].cdp.performance[0].TaskDuration')

# Send Report to Graphite
TIMESTAMP=$(date +%s)
BASIC_TOKEN=$(echo -n "username:shhhhhsecret" | base64 | tr -d '\n')

wget -qO- \
      --method POST \
      --header "content-type: application/json" \
      --header "Authorization: Basic $BASIC_TOKEN" \
      --body-data "[{\"name\": \"perf.login\", \"interval\": 1, \"value\": $PERF_REPORT , \"time\": $TIMESTAMP }]"  \
      "https://graphite-us-central1.grafana.net/metrics"