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

metrics: add tsdb persistence to AggHistogram #90769

Merged

Conversation

dhartunian
Copy link
Collaborator

@dhartunian dhartunian commented Oct 27, 2022

Previously, AggHistogram instances would not persist their quantiles to tsdb due to a missing interface implementation of metrics.WindowedHistogram. This PR adds a trivial implementation that delegates to the aggregate histogram instance within the struct.

This is relatively safe to do even though an AggHistogram could contain many children because we are only exporting a single set of aggregate quantiles per-AggHistogram. The children are only iterated over via the PrometheusIterable interface which is used by the prometheus exporter, but not by the metrics recorder.

Release note (bug fix, ops change): Previously, certain aggregate histograms would appear in _status/vars but not be available for graphing in the DB Console. These are now made available. They include changefeed-related histograms, and row-level-TTL histograms.

Epic: None

@dhartunian dhartunian requested a review from a team as a code owner October 27, 2022 15:03
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Previously, `AggHistogram` instances would not persist their quantiles to tsdb
due to a missing interface implementation of `metrics.WindowedHistogram`. This
PR adds a trivial implementation that delegates to the aggregate histogram
instance within the struct.

This is relatively safe to do even though an `AggHistogram` could contain many
children because we are only exporting a single set of aggregate quantiles
per-`AggHistogram`. The children are only iterated over via the
`PrometheusIterable` interface which is used by the prometheus exporter, but
not by the metrics recorder.

Release note (bug fix, ops change): Previously, certain aggregate histograms
would appear in `_status/vars` but not be available for graphing in the DB
Console. These are now made available. They include changefeed-related
histograms, and row-level-TTL histograms.

Epic: None
@dhartunian dhartunian force-pushed the fix-agg-histograms-not-recording-in-tsdb branch from 27f35a5 to 430306f Compare October 27, 2022 15:17
@dhartunian dhartunian added backport-22.2.x Flags PRs that need to be backported to 22.2. backport-22.2.0 and removed backport-22.2.0 labels Oct 27, 2022
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

not my code area, but lgtm!

@rafiss rafiss added the backport-22.1.x 22.1 is EOL label Oct 27, 2022
@dhartunian
Copy link
Collaborator Author

TFTRs!

bors r=rafiss,aadityasondhi

@craig
Copy link
Contributor

craig bot commented Oct 27, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-22.1.x 22.1 is EOL backport-22.2.x Flags PRs that need to be backported to 22.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants