Skip to content

metric: Report aggregate metric when no child metrics are present #149540

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alyshanjahani-crl
Copy link
Collaborator

SQLMetrics are PrometheusIterable, they are the first and only instance of metrics that dynamically add and remove childset metrics.

This commit fixes a bug where the includeAggregate flag being false (cluster setting disabled) resulting in these SQLMetrics not being reported.

When a PrometheusIterable has no child metrics it should report the aggregate regardless of the cluster setting.

Fixes: #149481

Release note (bug fix): When child metrics are enabled, include_aggregate is disabled, and the sql.metric.application_name/database_name are disabled, a handful of sql metrics were not being reported.

SQLMetrics are PrometheusIterable, they are the first and only instance of
metrics that dynamically add and remove childset metrics.

This commit fixes a bug where the includeAggregate flag being false (cluster
setting disabled) resulting in these SQLMetrics not being reported.

When a PrometheusIterable has no child metrics it should report the aggregate
regardless of the cluster setting.

Fixes: cockroachdb#149481

Release note (bug fix): When child metrics are enabled, include_aggregate is
disabled, and the sql.metric.application_name/database_name are disabled, a
handful of `sql` metrics were not being reported.
@alyshanjahani-crl alyshanjahani-crl requested review from a team as code owners July 4, 2025 18:45
@alyshanjahani-crl alyshanjahani-crl requested review from dhartunian, arjunmahishi, aa-joshi and Abhinav1299 and removed request for a team July 4, 2025 18:45
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

metric: when server.child_metrics.include_aggregate.enabled is set to false some SQL metrics fail to export
2 participants