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

kvserver: Expose Bytes Written to WAL #104890

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

raggar
Copy link
Contributor

@raggar raggar commented Jun 14, 2023

This change exposes the WAL.BytesWritten WAL.BytesIn metric from Pebble to the Cockroach Side. Proto changes seemed to have been made previously:

// wal_bytes_written is the number of bytes written to the WAL (counter).
uint64 wal_bytes_written = 28 [(gogoproto.jsontag) = ",omitempty"];

Fixes: #104531
Release note: None

@raggar raggar requested a review from a team as a code owner June 14, 2023 15:34
@blathers-crl
Copy link

blathers-crl bot commented Jun 14, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@raggar raggar changed the title Expose WAL.BytesWritten kvserver: Expose Bytes Written to WAL metric Jun 14, 2023
@raggar raggar requested a review from jbowens June 14, 2023 15:35
@RaduBerinde RaduBerinde requested a review from a team June 14, 2023 16:51
Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a graph for it. Grep for cr.store.rocksdb.flushed-bytes in storage.tsx and add a similar graph.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @RahulAggarwal1016)


pkg/kv/kvserver/metrics.go line 2017 at r1 (raw file):

	}

	metaWalBytesWritten = metric.Metadata{

nit: capitalize as WAL since WAL is an acronym.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms


pkg/kv/kvserver/metrics.go line 2022 at r1 (raw file):

		Measurement: "Events",
		Unit:        metric.Unit_COUNT,
	}

let's add a metric for Metrics.WAL.BytesIn too


pkg/kv/kvserver/metrics.go line 2260 at r1 (raw file):

	RaftStorageReadBytes      *metric.Counter

	// WAL even metrics

typo?


pkg/kv/kvserver/metrics.go line 2261 at r1 (raw file):

	// WAL even metrics
	WalBytesWritten *metric.Gauge

nit: capitalize as WAL since WAL is an acronym.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms


pkg/kv/kvserver/metrics.go line 2827 at r1 (raw file):

		// WAL metrics
		WalBytesWritten: metric.NewGauge(metaWalBytesWritten),

nit: no need to separate into a distinct block, can include with the above block of all storage metrics.

@raggar raggar force-pushed the rahul_expose_bytes_metric branch from e68a36c to 2b1fe00 Compare June 14, 2023 18:05
@raggar raggar requested a review from a team June 14, 2023 18:05
@raggar raggar force-pushed the rahul_expose_bytes_metric branch from 2b1fe00 to 1ba4675 Compare June 14, 2023 18:06
@raggar raggar changed the title kvserver: Expose Bytes Written to WAL metric kvserver: Expose Bytes Written to WAL Jun 14, 2023
Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)


pkg/kv/kvserver/metrics.go line 2017 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

nit: capitalize as WAL since WAL is an acronym.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms

Done

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)


pkg/kv/kvserver/metrics.go line 2022 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

let's add a metric for Metrics.WAL.BytesIn too

Done

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)


pkg/kv/kvserver/metrics.go line 2260 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

typo?

yup that was a typo

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)


pkg/kv/kvserver/metrics.go line 2261 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

nit: capitalize as WAL since WAL is an acronym.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms

Done

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)


pkg/kv/kvserver/metrics.go line 2827 at r1 (raw file):

Previously, jbowens (Jackson Owens) wrote…

nit: no need to separate into a distinct block, can include with the above block of all storage metrics.

Done

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens)

@raggar raggar requested review from RaduBerinde and jbowens June 14, 2023 18:09
Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens and @RahulAggarwal1016)


pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx line 236 at r3 (raw file):

    <LineGraph
      title="WAL Bytes In"

Not sure the "bytes in" metric is useful enough for a graph, it's up to @jbowens. I think having both would just raise questions from users.

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @RaduBerinde)


pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx line 236 at r3 (raw file):

Previously, RaduBerinde wrote…

Not sure the "bytes in" metric is useful enough for a graph, it's up to @jbowens. I think having both would just raise questions from users.

agreed

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens and @RaduBerinde)


pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx line 236 at r3 (raw file):

Previously, jbowens (Jackson Owens) wrote…

agreed

should I remove all the 'byte in' changes or just the graph? Does every time series metric need a graph in order to show up?

@jbowens
Copy link
Collaborator

jbowens commented Jun 15, 2023

should I remove all the 'byte in' changes or just the graph?

just the graph

Does every time series metric need a graph in order to show up?

a time series metric without a graph in the DB Console will still be exported (eg, to prometheus) and may be graphed on demand using the custom chart tool.

@raggar raggar force-pushed the rahul_expose_bytes_metric branch from 1ba4675 to c2ca0c2 Compare June 15, 2023 15:02
@raggar raggar requested review from jbowens and RaduBerinde June 15, 2023 15:02
Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, change made!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jbowens and @RaduBerinde)

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens)

Copy link
Contributor Author

@raggar raggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a command I can use to format the .tsx file? I think it fails linting

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jbowens and @RaduBerinde)

This change exposes the `WAL.BytesWritten` and `WAL.BytesIn` metric from
Pebble to the Cockroach Side.

Fixes: cockroachdb#104531
Release note: None
@raggar raggar force-pushed the rahul_expose_bytes_metric branch from c2ca0c2 to b485fd9 Compare June 16, 2023 15:08
@raggar
Copy link
Contributor Author

raggar commented Jun 16, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 16, 2023

Build succeeded:

@craig craig bot merged commit 6e641ff into cockroachdb:master Jun 16, 2023
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

Successfully merging this pull request may close these issues.

storage: expose log writer bytes timeseries metric
4 participants