Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spanner/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const (
metricLabelKeyDirectPathUsed = "directpath_used"
metricLabelKeyGRPCLBPickResult = "grpc.lb.pick_result"
metricLabelKeyGRPCLBDataPlaneTarget = "grpc.lb.rls.data_plane_target"
metricLabelKeyGRPCXDSResourceType = "grpc.xds.resource_type"

// Metric names
metricNameOperationLatencies = "operation_latencies"
Expand Down
1 change: 1 addition & 0 deletions spanner/metrics_monitoring_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var (
allowedMetricLabels = map[string]bool{
metricLabelKeyGRPCLBPickResult: true,
metricLabelKeyGRPCLBDataPlaneTarget: true,
metricLabelKeyGRPCXDSResourceType: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability and to avoid potential merge conflicts, it's a good practice to keep the keys in this map literal sorted alphabetically. While the current logical grouping by prefix is reasonable, a consistent alphabetical order is more scalable and less ambiguous as the list of labels grows. Please consider sorting all the entries in the allowedMetricLabels map.

metricLabelKeyClientUID: true,
metricLabelKeyClientName: true,
metricLabelKeyDatabase: true,
Expand Down
Loading