github.com/m3db/m3@v1.5.0/scripts/docker-integration-tests/prom_remote_write_backend/tests.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -xe
     4  
     5  source "$M3_PATH"/scripts/docker-integration-tests/common.sh
     6  source "$M3_PATH"/scripts/docker-integration-tests/prom_remote_write_backend/utils.sh
     7  
     8  function test_prometheus_remote_write_multi_namespaces {
     9    now=$(date +"%s")
    10    now_truncate_by=$(( now % 5 ))
    11    now_truncated=$(( now - now_truncate_by ))
    12    prometheus_raw_local_address="0.0.0.0:9090"
    13    prometheus_agg_local_address="0.0.0.0:9091"
    14    metric_name=prom_remote_write_test_metric
    15  
    16    # NB(antanas): just sending metrics multiple times to make sure everything is stable after startup.
    17    for _ in {1..10} ; do
    18      prometheus_remote_write \
    19        $metric_name $now_truncated 42 \
    20        true "Expected request to succeed" \
    21        200 "Expected request to return status code 200"
    22    done
    23  
    24    echo "Querying for data in raw prometheus"
    25    query_metric $metric_name $prometheus_raw_local_address
    26  
    27    echo "Querying for data in aggregated prometheus"
    28    query_metric "${metric_name}_rolled_up" $prometheus_agg_local_address
    29  }