8000 The GRPS protocol does not record tags in system metrics such as scenario and etc · Issue #10 · szkiba/xk6-prometheus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The GRPS protocol does not record tags in system metrics such as scenario and etc #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HarryHoudini opened this issue May 30, 2023 · 3 comments

Comments

@HarryHoudini
Copy link

Hi. Thank for Prometheus exporter and your job. This is only one solution for scrapping metrics with prometheus.

I encountered an error. When I started tests with custom tags in scenario for grpc service I receive error Not all tags used as labels from line https://github.com/szkiba/xk6-prometheus/blob/master/internal/prometheus.go#L114
I did't see scenario tag or another tag which I add in scenario script.

grpc test scenario.

import grpc from 'k6/net/grpc';
import { check, sleep } from 'k6';


export const options = {
  scenarios: {
    shared_iter_scenario: {
      executor: 'shared-iterations',
      vus: 10,
      iterations: 10000,
      startTime: '0s',
      tags: {
        testid: 'someTestId-for-shared',
      },
    },
    per_vu_scenario: {
      executor: 'per-vu-iterations',
      vus: 10,
      iterations: 1000,
      startTime: '5s',
      tags: {
        testid: 'someTestId-for-per-vu',
      },
    },
  },
};

const client = new grpc.Client();
client.load(['definitions'], 'hello.proto');

export default function () {
  client.connect('grpcb.in:9001', {
    // plaintext: false
  });

  const data = { greeting: 'Bert' };
  const response = client.invoke('hello.HelloService/SayHello', data);

  check(response, {
    'status is OK': (r) => r && r.status === grpc.StatusOK,
  });

  console.log(JSON.stringify(response.message));

  client.close();
  sleep(1);
};

http test scenario.

import http from 'k6/http';

export const options = {
scenarios: {
  shared_iter_scenario: {
    executor: 'shared-iterations',
    vus: 10,
    iterations: 10000,
    startTime: '0s',
    tags: {
      testid: 'someTestId-for-shared',
    },
  },
  per_vu_scenario: {
    executor: 'per-vu-iterations',
    vus: 10,
    iterations: 1000,
    startTime: '5s',
    tags: {
      testid: 'someTestId-for-per-vu',
    },
  },
},
};

export default function () {
http.get('https://test.k6.io/');
}

I'm getting this error only when start test for grpc service. When I start test for http protocol it's work as expected - all tags is setted.

http

k6_data_received{instance="k6-test-runner:5656", job="k6_job", scenario="per_vu_scenario", testid="someTestId-for-per-vu"} | 16995 @1685451227.496
-- | --
k6_data_received{instance="k6-test-runner:5656", job="k6_job", scenario="shared_iter_scenario", testid="someTestId-for-shared"} | 261966 @1685451227.496
k6_data_sent{instance="k6-test-runner:5656", job="k6_job", scenario="per_vu_scenario", testid="someTestId-for-per-vu"} | 438 @1685451227.496
k6_data_sent{instance="k6-test-runner:5656", job="k6_job", scenario="shared_iter_scenario", testid="someTestId-for-shared"}

grpc

k6_checks_sum{check="server is healthy", group="::setup", instance="k6-test-runner:5656", job="k6_job"} | 1 @1685453357.4961 @1685453362.4961 @1685453367.496
-- | --
k6_checks_sum{check="status is OK", instance="k6-test-runner:5656", job="k6_job"} | 4 @1685453362.4968 @1685453367.496
k6_data_received{group="::setup", instance="k6-test-runner:5656", job="k6_job"} | 213489 @1685453357.496213489 @1685453362.496213489 @1685453367.496
k6_data_received{instance="k6-test-runner:5656", job="k6_job"} | 10579 @1685453362.49621035 @1685453367.496
k6_data_sent{group="::setup", instance="k6-test-runner:5656", job="k6_job"} | 441 @1685453357.496441 @1685453362.496441 @1685453367.496
k6_data_sent{instance="k6-test-runner:5656", job="k6_job"}

I notice two things

  1. Only iteration metrics have tags as label when I start test for grpc.
k6_iterations{instance="k6-test-runner:5656", job="k6_job", scenario="searchFast", testid="searchScenarios--002"} 
  1. Custom tags work is good.
k6_errors_response_not_ok_sum{instance="k6-test-runner:5656", job="k6_job", scenario="searchFast", testid="searchScenarios--002"}

Below is screen from prometheus for same metrics for http and grpc.
image

@HarryHoudini HarryHoudini changed the title The GRPS protocol does not record tags in system metrics such as scenario The GRPS protocol does not record tags in system metrics such as scenario and etc May 30, 2023
@HarryHoudini
Copy link
Author

@szkiba hello, maybe you need more information?

@szkiba
Copy link
Owner
szkiba commented Jun 26, 2023

Sorry for the delay. I'm asking for a little more patience, I'm on vacation, and then I'll start a new job. I can probably deal with the problem in mid-August.

@HarryHoudini
Copy link
Author

Sorry, but it's still actual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0