K6 Cloud results not shown up on grafana cloud using prometheus data source

Here is my flow:
K6 run -o cloud xx.js (K6 cloud results are good) ===> Prometheus ===> Grafana cloud

Below steps worked on to make my load test results visible on grafana cloud:

  1. I have javascript that works fine for k6 local and cloud to publish results. for prometheus i have added below sample code.

  2. I have updated K6 → Cloud APM configuration for prometheus

  3. also, added grafana cloud with “prometheus details”

  4. Added new data source to grafana and made sure data source is working with basic authentication.

export const options = {
  ext: {
    loadimpact: {
      apm: [
        {
          provider: 'prometheus',
          remoteWriteURL: '<Remote Write URL>',
          // optional parameters
          credentials: {
            username: '<user>',
            password: '<token>'
          },
          includeDefaultMetrics: true,
          metrics: ['http_req_sending', 'my_rate', 'my_gauge'], //...other options,
          includeTestRunId: false,
          resampleRate: 3,
        },
      ],
    },
  },
};

Result: I am not seeing prometheus as per below screen shot from my k6 cloud account… also, grafana with prometheus dashboard don’t saw anything.

Hey @jigisha.shah,

Cloud APM is a k6 Cloud feature and won’t work if you’re running k6 locally and only sending results to k6 Cloud. For this, you need to use xk6-output-prometheus-remote to send metrics from your local k6 instance to Prometheus Remote Write.

aha! got it.

Thanks @mostafa

@mostafa - I can switch to K6 cloud run instead local-to-cloud so i can keep other configurations as is…but my endpoints failed execution on cloud… how to set auth on k6 cloud for endpoints which run on our vpn only.

@jigisha.shah :slight_smile:

That’s a separate issue. But I suppose you should open ports on your firewall. Please have a look at this: