github.com/ava-labs/avalanchego@v1.11.11/.github/actions/run-monitored-tmpnet-cmd/notify-metrics-availability.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -euo pipefail
     4  
     5  # Timestamps are in seconds
     6  from_timestamp="$(date '+%s')"
     7  monitoring_period=900 # 15 minutes
     8  to_timestamp="$((from_timestamp + monitoring_period))"
     9  
    10  # Grafana expects microseconds, so pad timestamps with 3 zeros
    11  metrics_url="${GRAFANA_URL}&var-filter=gh_job_id%7C%3D%7C${GH_JOB_ID}&from=${from_timestamp}000&to=${to_timestamp}000"
    12  
    13  # Optionally ensure that the link displays metrics only for the shared
    14  # network rather than mixing it with the results for private networks.
    15  if [[ -n "${FILTER_BY_OWNER:-}" ]]; then
    16    metrics_url="${metrics_url}&var-filter=network_owner%7C%3D%7C${FILTER_BY_OWNER}"
    17  fi
    18  
    19  echo "::notice links::metrics ${metrics_url}"