Issue with Prometheus Remote - panic: runtime error: index out of range [1] with length 1

Hello All,

Prometheus is up and running, getting “panic: runtime error: index out of range [1] with length 1”
Following is the error trace

INFO[0000] Prometheus: configuring remote-write with prometheus mapping 
  execution: local
     script: 01_http_get.js
     output: Output k6 metrics to prometheus remote-write endpoint

  scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
           * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

panic: runtime error: index out of range [1] with length 1
running (00m00.9s), 1/1 VUs, 0 complete and 0 interrupted iterations
goroutine 62 [running]:--------------------------] 1 VUs  00m00.9s/10m0s  0/1 iters, 1 per VU*PrometheusMapping).MapTrend(0x104ae14?, 0x300?, {0xc000695290, {0xc09a173d594b3070, 0x4cc3b268, 0x2e0dc00}, 0xc000bba2e0, 0x408207d4fdf3b646}, {0xc000e09200, 0x7, ...}) +0x1a0d*metricsStorage).transform(0xc000040119?, {0x234c558?, 0x2e406d8?}, {0xc000695290, {0xc09a173d594b3070, 0x4cc3b268, 0x2e0dc00}, 0xc000bba2e0, 0x408207d4fdf3b646}, {0xc000e09200, ...}) +0x24c*Output).convertToTimeSeries(0xc000d65440, {0xc0029e2260, 0x1, 0xffffffffffffffff?}) +0x352*Output).flush(0xc000d65440) +0xeb*PeriodicFlusher).run(0xc000d674a0) +0x88
created by +0x136

Hi @BharathM, welcome to the community forum :tada:

This looks like a serious bug - please report it in the project issue tracker preferably with a sample script that reproduces it :wink:

Hello @mstoykov , Thank you. It got resolved automatically, I was just trying the following commands

K6_PROMETHEUS_REMOTE_URL=http://localhost:9090/api/v1/write \
    /Users/test1/Documents/SF/go/bin/k6 run 02_http_get_options.js -o output-prometheus-remote

    /Users/test1/Documents/SF/go/bin/k6 run 01_http_get.js -o output-prometheus-remote