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 contention graphs and open sql connections to metrics page in CC #73566

Closed
5 of 6 tasks
xinhaoz opened this issue Dec 7, 2021 · 7 comments
Closed
5 of 6 tasks

Add contention graphs and open sql connections to metrics page in CC #73566

xinhaoz opened this issue Dec 7, 2021 · 7 comments
Labels
A-sql-observability Related to observability of the SQL layer C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@xinhaoz
Copy link
Member

xinhaoz commented Dec 7, 2021

As per #69799, the metrics page with some preliminary graphs was created for CC serverless. The following metrics need to be surfaced and the graphs should be added to the metrics page:

  • Open SQL Sessions - "The total number of open SQL sessions. This includes both active and idle sessions."
  • Transaction contention - "The total number of transactions that experienced contention."
  • SQL Statement Contention - "The total number of statements that experienced contention."
  • SQL Connection latency (90th and 99th percentile) - "The connection latency in nanoseconds between when the cluster receives a connection request and establishes the connection to the client, including authentication."
  • SQL Connection attempts - "The total number of connection attempts to the cluster". (sql.new_conns)
  • SQL Connection errors - "The total number of connection errors to the cluster."

Epic CC-5060

Jira issue: CRDB-11647

@xinhaoz xinhaoz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-observability Related to observability of the SQL layer T-sql-observability labels Dec 7, 2021
@Azhng
Copy link
Contributor

Azhng commented Mar 28, 2022

Writing up a quick update here, CRDB currently doesn't emit the second Transaction Contention metrics.

However, emitting the transaction contention metrics is currently blocked by a bug (#78675). (this is either a bug within a the trace analyzer or vectorized stats collector, still investigating).

@kevin-v-ngo
Copy link

Thanks for updating the thread @Azhng. I added the 3 Connection metrics as well which came up in a couple threads. They should be already available but if not, let me know and we can create a separate issue.

@Azhng
Copy link
Contributor

Azhng commented Mar 30, 2022

I think the SQL Connection errors is not yet available.

Azhng added a commit to Azhng/cockroach that referenced this issue Apr 7, 2022
Related to cockroachdb#73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.
Azhng added a commit to Azhng/cockroach that referenced this issue Apr 7, 2022
Related to cockroachdb#73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.
Azhng added a commit to Azhng/cockroach that referenced this issue Apr 7, 2022
Related to cockroachdb#73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.
craig bot pushed a commit that referenced this issue Apr 11, 2022
79175: sql: collect contention stats for sql stats when tracing is enabled r=yuzefovich a=Azhng

Resolves #78675

Previously, contention stats was not collected for SQL Stats even when
tracing was enabled. This was caused by two bugs:
1. instrumentationHelper skipping analyzing traces when tracing is enabled
2. transaction statistics ignore traces when tracing is turned on at the
higher level.

This commit ensures that contention stats is collected when tracing is
turned on.

Release note (bug fix): Contention statistics are now being collected for
SQL Stats when tracing is enabled.

79606: sql/pgwire: add sql.conn.failures metric r=maryliag a=Azhng

Related to #73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.

79670: Updates to restore & backup sql diagrams r=ericharmeling a=kathancox

Release note: None

79772: ui: fix raft messages graph r=Santamaura a=Santamaura

Previously, when a user attempted to drag-to-zoom on the graph or use
the date picker it would not work properly. This is due to missing props
that set the time window and the time scale. Therefore, this patch
updates the props to include these in order to have the date picker and
graph drag-to-zoom working again.

resolves #79614

Release note (bug fix): Update props on the raft messages page to
include functions to set the time window and time scale in order
to fix date picker and drag-to-zoom functionality.

Co-authored-by: Azhng <[email protected]>
Co-authored-by: Kathryn Hancox <[email protected]>
Co-authored-by: Santamaura <[email protected]>
Azhng added a commit to Azhng/cockroach that referenced this issue Apr 13, 2022
Expose transaction contention metric for cockroachdb#73566.

Release note (sql change): new sql.txn.contended.count metric
exposes total number of transactions that experienced contentions.
@Azhng Azhng closed this as completed Apr 13, 2022
@kevin-v-ngo
Copy link

@Azhng can you paste screenshots of the charts here? Adding @Annebirzin as FYI

@Azhng Azhng reopened this Apr 13, 2022
@Azhng
Copy link
Contributor

Azhng commented Apr 13, 2022

s.mov

@Azhng
Copy link
Contributor

Azhng commented Apr 13, 2022

Oops the issue got closed by accident.

@Annebirzin
Copy link

Annebirzin commented Apr 19, 2022

Nice! I had a few nits (mostly copy updates):

SQL Connection Latency

  • it looks like there are 2 lines represented but we are missing the bottom key to tell you what those lines mean (it would look similar to the SQL Statement Latency graph key)
  • The y-axis shows ms twice

SQL Statement Latency

  • The y-axis shows ms twice

SQL Open Sessions

  • Update title to Open SQL Sessions (consistent with Open SQL Transactions)
  • Update the y-axis to just Sessions to remove redundancy with the title and make it consistent with Open SQL Transactions

SQL Connection Attempts

  • Update the y-axis to Connection Attempts to simplify and remove redundancy with the title

Full Scans

  • For the y-axis, capitalize Scans

Statement Errors

  • For the y-axis, capitalize Errors

SQL Statement Contention

  • Update the y-axis to Statements

General

  • For graphs like SQL Connection Attempts, SQL Statment Errors, or SQL Statement Contention (among others), I'm not sure it makes sense to have fractions on the y-axis. For example, would it ever show 0.2 statements with contention? Could we make it so graphs with whole number counts always start at 1? (this might be a separate issue)

cc @kevin-v-ngo
cc @stbof for any other copy feedback

Azhng added a commit to Azhng/cockroach that referenced this issue Apr 20, 2022
Expose transaction contention metric for cockroachdb#73566.

Release note (sql change): new sql.txn.contended.count metric
exposes total number of transactions that experienced contentions.
Azhng added a commit to Azhng/cockroach that referenced this issue May 4, 2022
Expose transaction contention metric for cockroachdb#73566.

Release note (sql change): new sql.txn.contended.count metric
exposes total number of transactions that experienced contentions.
blathers-crl bot pushed a commit that referenced this issue May 4, 2022
Related to #73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.
blathers-crl bot pushed a commit that referenced this issue May 4, 2022
Related to #73566

This commit adds the the new sql.conn.failures counter metric that
reflects the number of failed SQL connections.

Release note (sql change): the new sql.conn.failures counter metric shows
number of failed SQL connections.
craig bot pushed a commit that referenced this issue May 5, 2022
79176: sql: add sql.txn.contended.count metric r=Azhng a=Azhng

Expose transaction contention metric for #73566.

Release note (sql change): new sql.txn.contended.count metric
exposes total number of transactions that experienced contentions.

Co-authored-by: Azhng <[email protected]>
Azhng added a commit to Azhng/cockroach that referenced this issue May 5, 2022
Expose transaction contention metric for cockroachdb#73566.

Release note (sql change): new sql.txn.contended.count metric
exposes total number of transactions that experienced contentions.
@maryliag maryliag closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-observability Related to observability of the SQL layer C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

6 participants