Skip to content

Commit 74d350a

Browse files
committed
gen-cockroach-metrics: tweak a regexp
This still filters out the large gossip histograms, but keeps the processed callbacks metric.
1 parent 0250a25 commit 74d350a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build/tools/gen-cockroachdb-metrics/main.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var (
9696
skipPatterns = []*regexp.Regexp{
9797
regexp.MustCompile(`^auth_`),
9898
regexp.MustCompile(`^distsender_rpc_err_errordetailtype_`),
99-
regexp.MustCompile(`^gossip_callbacks_`),
99+
regexp.MustCompile(`^gossip_callbacks_[^_]+_`),
100100
regexp.MustCompile(`^jobs_auto_config_env_runner_`),
101101
regexp.MustCompile(`^jobs_update_table_`),
102102
regexp.MustCompile(`^logical_replication_`),
@@ -304,7 +304,9 @@ func loadBaseMappings(path string) (*BaseMappingsYAML, error) {
304304

305305
// collectAllCRDBMetrics collects all CRDB metrics from the YAML output and combines them
306306
// with any runtime conditional metrics that aren't documented in metrics.yaml
307-
func collectAllCRDBMetrics(yamlOutput *YAMLOutput, runtimeConditionalMetrics []MetricInfo) []MetricInfo {
307+
func collectAllCRDBMetrics(
308+
yamlOutput *YAMLOutput, runtimeConditionalMetrics []MetricInfo,
309+
) []MetricInfo {
308310
allMetrics := make([]MetricInfo, 0)
309311

310312
for _, layer := range yamlOutput.Layers {
@@ -328,7 +330,9 @@ func shouldSkipMetric(promName string) bool {
328330
}
329331

330332
// mapMetricsToDatadog processes the CRDB metrics and maps them to Datadog names
331-
func mapMetricsToDatadog(metrics []MetricInfo, datadogMappings map[string]string) map[string]string {
333+
func mapMetricsToDatadog(
334+
metrics []MetricInfo, datadogMappings map[string]string,
335+
) map[string]string {
332336
result := make(map[string]string)
333337

334338
for _, metric := range metrics {
@@ -465,7 +469,7 @@ func main() {
465469
flag.Parse()
466470

467471
args := flag.Args()
468-
472+
469473
// Check if running in datadog-only mode
470474
if *datadogOnly {
471475
if len(flag.Args()) < 2 {

pkg/roachprod/agents/opentelemetry/files/cockroachdb_metrics.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ go_scheduler_latency_sum: go.scheduler_latency.sum
701701
gossip_bytes_received: gossip.bytes.received
702702
gossip_bytes_sent: gossip.bytes.sent
703703
gossip_callbacks_pending: gossip.callbacks.pending
704+
gossip_callbacks_processed: gossip.callbacks.processed
704705
gossip_connections_incoming: gossip.connections.incoming
705706
gossip_connections_outgoing: gossip.connections.outgoing
706707
gossip_connections_refused: gossip.connections.refused

0 commit comments

Comments
 (0)