Skip to content

Conversation

@jasonlmfong
Copy link
Member

This change adds the ability to get changefeed child metrics to be recorded. The child metrics have their names augmented with their labels.

Epic: CRDB-55079
Release: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Comment on lines +236 to +241
if m.EnableLowFreqChildCollection == nil {
return true
}
return *m.EnableLowFreqChildCollection
}

Copy link
Member Author

Choose a reason for hiding this comment

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

chose to default this to true because I think it would be quite painful to manually turn this on for each metric

Comment on lines +475 to +493
// Record child metrics from app registry for system tenant only.
now := mr.clock.Now()
recorder := registryRecorder{
registry: mr.mu.appRegistry,
format: nodeTimeSeriesPrefix,
source: mr.mu.desc.NodeID.String(),
timestampNanos: now.UnixNano(),
}
recorder.recordChangefeedChildMetrics(&data)

// Record child metrics from app-level registries for secondary tenants
for tenantID, r := range mr.mu.tenantRegistries {
tenantRecorder := registryRecorder{
registry: r,
format: nodeTimeSeriesPrefix,
source: tsutil.MakeTenantSource(mr.mu.desc.NodeID.String(), tenantID.String()),
timestampNanos: now.UnixNano(),
}
tenantRecorder.recordChangefeedChildMetrics(&data)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

changefeed metrics only live on app registry (and tenant app registry)

for i, label := range childMetric.Label {
sanitizedLabels[i].key = metric.ExportedLabel(label.GetName())
sanitizedLabels[i].value = label.GetValue()
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this is aligned with prometheus export:
keys are cleaned and values are preserved

12,
"/System/tsd//1m/1924-09-18T08:00:00Z/",
},
{
Copy link
Member Author

Choose a reason for hiding this comment

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

prove that keys can have special characters

This change adds the ability to get changefeed child metrics to be recorded. The child metrics have their names augmented with their labels.

Epic: CRDB-55079
Release: None
@jasonlmfong jasonlmfong force-pushed the jf/ts-collect-lfhc-changefeed branch from 4748184 to 2c02b81 Compare November 20, 2025 19:06
@jasonlmfong jasonlmfong marked this pull request as ready for review November 20, 2025 19:07
@jasonlmfong jasonlmfong requested review from a team as code owners November 20, 2025 19:07
@jasonlmfong jasonlmfong requested review from Abhinav1299, aa-joshi and arjunmahishi and removed request for a team November 20, 2025 19:07
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.

2 participants