grafana / xk6-dashboard

A k6 extension that makes k6 metrics available on a web-based dashboard.
GNU Affero General Public License v3.0
343 stars 30 forks source link

What is the supported k6 version? #6

Closed mkadirtan closed 1 year ago

mkadirtan commented 1 year ago
#13 0.452 2022/12/30 14:54:49 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -require github.com/szkiba/xk6-dashboard@latest 
#13 0.459 2022/12/30 14:54:49 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17 
#13 0.983 go: downloading github.com/szkiba/xk6-dashboard v0.1.1
#13 12.19 go: downloading github.com/prometheus/client_golang v0.9.3
#13 12.19 go: downloading github.com/gorilla/schema v1.2.0
#13 12.19 go: downloading github.com/sirupsen/logrus v1.8.1
#13 12.19 go: downloading github.com/alexandrevicenzi/go-sse v1.6.0
#13 12.19 go: downloading go.k6.io/k6 v0.32.0
...
#13 85.73 go: finding module for package go.k6.io/k6/stats
#13 86.28 go: downloading go.k6.io/k6 v0.42.0
#13 87.06 k6 imports
#13 87.06       github.com/szkiba/xk6-dashboard imports
#13 87.06       github.com/szkiba/xk6-dashboard/internal imports
#13 87.06       go.k6.io/k6/stats: module go.k6.io/k6@latest found (v0.42.0), but does not contain package go.k6.io/k6/stats
#13 87.10 2022/12/30 14:56:15 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-12-30-1454.110475767
#13 87.10 2022/12/30 14:56:15 [FATAL] exit status 1

I'm trying to build k6 with xk6-dashboard, but I keep getting error about k6/stats module. Is this extension not compatible with latest k6 module?


WORKDIR $GOPATH/src/go.k6.io/k6
ADD . .
RUN apk --no-cache add build-base git
RUN go install go.k6.io/xk6/cmd/xk6@latest

#
# 1) Copy the following `--with ...` line, modifying the module name for additional extension(s).
# 2) CGO_ENABLED will ideally be '0' (disabled), but some extensions require it be enabled. (See docs for your extensions)
#
RUN CGO_ENABLED=0 xk6 build v0.42.0 \
    --with github.com/szkiba/xk6-dashboard@latest \
    # --with github.com/grafana/xk6-websockets@latest \
    # --with github.com/grafana/xk6-timers@latest \
    # --with github.com/grafana/xk6-output-timescaledb \
    # --with github.com/grafana/xk6-output-influxdb \
    --output /tmp/k6```
ticup commented 1 year ago

Same issue here.

gallolp commented 1 year ago

It seems the stats package was moved to metrics here -> https://github.com/grafana/k6/commit/766afc4bf6d2a5a86d6b80daafc77c02c64d2eb5

This was published in 0.38.0 so the last version that passes the build with xk6-dashboard is 0.37.0

$ xk6 build v0.37.0 --with github.com/szkiba/xk6-dashboard
gallolp commented 1 year ago

Simply replacing stats with metrics in the prometheus module seems to do the trick.

$ xk6 build v0.42.0 --with github.com/szkiba/xk6-dashboard=${PWD}/xk6-dashboard
$ ./k6 version
k6 v0.42.0 ((devel), go1.19.5, linux/amd64)
szkiba commented 1 year ago

Should work now (v0.1.2).