Skip to content
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

Add metrics for CQL request and response sizes #13061

Closed
vladzcloudius opened this issue Mar 2, 2023 · 6 comments
Closed

Add metrics for CQL request and response sizes #13061

vladzcloudius opened this issue Mar 2, 2023 · 6 comments

Comments

@vladzcloudius
Copy link
Contributor

vladzcloudius commented Mar 2, 2023

Installation details
HEAD: b6e4275

Description
We need metrics that would allow us reasoning about sizes of requests and the amount of data that is returned.

We can start with averages but histograms would definitely make sense eventually.

vladzcloudius added a commit to vladzcloudius/scylla that referenced this issue Mar 2, 2023
This patch reorganizes and extends CQL related metrics.
Before this patch we only had counters for specific CQL requests.

However, many times we need to reason about the size of CQL queries: corresponding
requests and response sizes.

This patch adds corresponding metrics:
  - Arranges all 3 per-opcode statistics counters in a single struct.
  - Defines a vector of such structs for each CQL opcode.
  - Adjusts statistics updates accordingly - the code is much simpler
    now.
  - Removes old metrics that were accounting some CQL opcodes.
  - Adds new per-opcode metrics for requests number, request and response sizes:
     - New metrics are of a derived kind - rate() should be applied to them.
     - There are 3 new metrics names:
       - 'cql_requests_count'
       - 'cql_request_bytes'
       - 'cql_response_bytes'
     - New metrics have a per-opcode label - 'kind'.

 For example:

 A number of response bytes for an EXECUTE opcode on shard 0 looks as follows:

 scylla_transport_cql_response_bytes{kind="EXECUTE",shard="0"}

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
vladzcloudius added a commit to vladzcloudius/scylla that referenced this issue Mar 2, 2023
This patch reorganizes and extends CQL related metrics.
Before this patch we only had counters for specific CQL requests.

However, many times we need to reason about the size of CQL queries: corresponding
requests and response sizes.

This patch adds corresponding metrics:
  - Arranges all 3 per-opcode statistics counters in a single struct.
  - Defines a vector of such structs for each CQL opcode.
  - Adjusts statistics updates accordingly - the code is much simpler
    now.
  - Removes old metrics that were accounting some CQL opcodes.
  - Adds new per-opcode metrics for requests number, request and response sizes:
     - New metrics are of a derived kind - rate() should be applied to them.
     - There are 3 new metrics names:
       - 'cql_requests_count'
       - 'cql_request_bytes'
       - 'cql_response_bytes'
     - New metrics have a per-opcode label - 'kind'.

 For example:

 A number of response bytes for an EXECUTE opcode on shard 0 looks as follows:

 scylla_transport_cql_response_bytes{kind="EXECUTE",shard="0"}

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
@mykaul mykaul added this to the 5.3 milestone Mar 5, 2023
avikivity pushed a commit that referenced this issue Mar 7, 2023
This patch reorganizes and extends CQL related metrics.
Before this patch we only had counters for specific CQL requests.

However, many times we need to reason about the size of CQL queries: corresponding
requests and response sizes.

This patch adds corresponding metrics:
  - Arranges all 3 per-opcode statistics counters in a single struct.
  - Defines a vector of such structs for each CQL opcode.
  - Adjusts statistics updates accordingly - the code is much simpler
    now.
  - Removes old metrics that were accounting some CQL opcodes.
  - Adds new per-opcode metrics for requests number, request and response sizes:
     - New metrics are of a derived kind - rate() should be applied to them.
     - There are 3 new metrics names:
       - 'cql_requests_count'
       - 'cql_request_bytes'
       - 'cql_response_bytes'
     - New metrics have a per-opcode label - 'kind'.

 For example:

 A number of response bytes for an EXECUTE opcode on shard 0 looks as follows:

 scylla_transport_cql_response_bytes{kind="EXECUTE",shard="0"}

Ref #13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230302154816.299721-1-vladz@scylladb.com>
avikivity pushed a commit that referenced this issue Mar 22, 2023
This patch extends a previous patch that added these metrics globally:
 - cql_requests_count
 - cql_request_bytes
 - cql_response_bytes

This patch adds a "scheduling_group_name" label to these metrics and changes corresponding
counters to be accounted on a per-scheduling-group level.

As a bonus this patch also marks all 3 metrics as 'skip_when_empty'.

Ref #13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230321201412.3004845-1-vladz@scylladb.com>
vladzcloudius added a commit to vladzcloudius/scylla that referenced this issue Mar 23, 2023
This patch reorganizes and extends CQL related metrics.
Before this patch we only had counters for specific CQL requests.

However, many times we need to reason about the size of CQL queries: corresponding
requests and response sizes.

This patch adds corresponding metrics:
  - Arranges all 3 per-opcode statistics counters in a single struct.
  - Defines a vector of such structs for each CQL opcode.
  - Adjusts statistics updates accordingly - the code is much simpler
    now.
  - Removes old metrics that were accounting some CQL opcodes.
  - Adds new per-opcode metrics for requests number, request and response sizes:
     - New metrics are of a derived kind - rate() should be applied to them.
     - There are 3 new metrics names:
       - 'cql_requests_count'
       - 'cql_request_bytes'
       - 'cql_response_bytes'
     - New metrics have a per-opcode label - 'kind'.

 For example:

 A number of response bytes for an EXECUTE opcode on shard 0 looks as follows:

 scylla_transport_cql_response_bytes{kind="EXECUTE",shard="0"}

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230302154816.299721-1-vladz@scylladb.com>
(cherry picked from commit ae6724f)
vladzcloudius added a commit to vladzcloudius/scylla that referenced this issue Mar 23, 2023
This patch extends a previous patch that added these metrics globally:
 - cql_requests_count
 - cql_request_bytes
 - cql_response_bytes

This patch adds a "scheduling_group_name" label to these metrics and changes corresponding
counters to be accounted on a per-scheduling-group level.

As a bonus this patch also marks all 3 metrics as 'skip_when_empty'.

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230321201412.3004845-1-vladz@scylladb.com>
(cherry picked from commit f94bbc5)
@DoronArazii
Copy link

@mykaul / @vladzcloudius can we close it? or it requires more work?

@vladzcloudius
Copy link
Contributor Author

@mykaul / @vladzcloudius can we close it? or it requires more work?

We should close it only after histograms are added (mentioned in the opening message).

@mykaul
Copy link
Contributor

mykaul commented Apr 20, 2023

@mykaul / @vladzcloudius can we close it? or it requires more work?

We should close it only after histograms are added (mentioned in the opening message).

Thanks @vladzcloudius - will you be able to complete this work (we hope to branch out 5.3 very soon). Alternatively, we may prefer to open a separate GH issue to track that activity?

@vladzcloudius
Copy link
Contributor Author

@mykaul / @vladzcloudius can we close it? or it requires more work?

We should close it only after histograms are added (mentioned in the opening message).

Thanks @vladzcloudius - will you be able to complete this work (we hope to branch out 5.3 very soon). Alternatively, we may prefer to open a separate GH issue to track that activity?

No. I'm not planning to work on that any time soon.

@mykaul
Copy link
Contributor

mykaul commented Apr 20, 2023

@mykaul / @vladzcloudius can we close it? or it requires more work?

We should close it only after histograms are added (mentioned in the opening message).

Thanks @vladzcloudius - will you be able to complete this work (we hope to branch out 5.3 very soon). Alternatively, we may prefer to open a separate GH issue to track that activity?

No. I'm not planning to work on that any time soon.

Thanks - then I'm in favor of opening a separate item to track the histogram request.

@DoronArazii
Copy link

@mykaul / @vladzcloudius can we close it? or it requires more work?

We should close it only after histograms are added (mentioned in the opening message).

Closing as completed.

kbr-scylla pushed a commit to kbr-scylla/scylladb that referenced this issue Aug 2, 2023
This patch reorganizes and extends CQL related metrics.
Before this patch we only had counters for specific CQL requests.

However, many times we need to reason about the size of CQL queries: corresponding
requests and response sizes.

This patch adds corresponding metrics:
  - Arranges all 3 per-opcode statistics counters in a single struct.
  - Defines a vector of such structs for each CQL opcode.
  - Adjusts statistics updates accordingly - the code is much simpler
    now.
  - Removes old metrics that were accounting some CQL opcodes.
  - Adds new per-opcode metrics for requests number, request and response sizes:
     - New metrics are of a derived kind - rate() should be applied to them.
     - There are 3 new metrics names:
       - 'cql_requests_count'
       - 'cql_request_bytes'
       - 'cql_response_bytes'
     - New metrics have a per-opcode label - 'kind'.

 For example:

 A number of response bytes for an EXECUTE opcode on shard 0 looks as follows:

 scylla_transport_cql_response_bytes{kind="EXECUTE",shard="0"}

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230302154816.299721-1-vladz@scylladb.com>
(cherry picked from commit ae6724f)
kbr-scylla pushed a commit to kbr-scylla/scylladb that referenced this issue Aug 2, 2023
This patch extends a previous patch that added these metrics globally:
 - cql_requests_count
 - cql_request_bytes
 - cql_response_bytes

This patch adds a "scheduling_group_name" label to these metrics and changes corresponding
counters to be accounted on a per-scheduling-group level.

As a bonus this patch also marks all 3 metrics as 'skip_when_empty'.

Ref scylladb#13061

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <20230321201412.3004845-1-vladz@scylladb.com>
(cherry picked from commit f94bbc5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants