mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	APF: use snake_case in metric labels
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
This commit is contained in:
		@@ -167,7 +167,7 @@ func (uss *uniformScenarioState) exercise() {
 | 
				
			|||||||
	for i, uc := range uss.clients {
 | 
						for i, uc := range uss.clients {
 | 
				
			||||||
		uss.integrators[i] = fq.NewIntegrator(uss.clk)
 | 
							uss.integrators[i] = fq.NewIntegrator(uss.clk)
 | 
				
			||||||
		fsName := fmt.Sprintf("client%d", i)
 | 
							fsName := fmt.Sprintf("client%d", i)
 | 
				
			||||||
		uss.expectedInqueue = uss.expectedInqueue + fmt.Sprintf(`				apiserver_flowcontrol_current_inqueue_requests{flowSchema=%q,priorityLevel=%q} 0%s`, fsName, uss.name, "\n")
 | 
							uss.expectedInqueue = uss.expectedInqueue + fmt.Sprintf(`				apiserver_flowcontrol_current_inqueue_requests{flow_schema=%q,priority_level=%q} 0%s`, fsName, uss.name, "\n")
 | 
				
			||||||
		for j := 0; j < uc.nThreads; j++ {
 | 
							for j := 0; j < uc.nThreads; j++ {
 | 
				
			||||||
			ust := uniformScenarioThread{
 | 
								ust := uniformScenarioThread{
 | 
				
			||||||
				uss:    uss,
 | 
									uss:    uss,
 | 
				
			||||||
@@ -309,10 +309,10 @@ func (uss *uniformScenarioState) finalReview() {
 | 
				
			|||||||
	for i := range uss.clients {
 | 
						for i := range uss.clients {
 | 
				
			||||||
		fsName := fmt.Sprintf("client%d", i)
 | 
							fsName := fmt.Sprintf("client%d", i)
 | 
				
			||||||
		if atomic.AddInt32(&uss.executions[i], 0) > 0 {
 | 
							if atomic.AddInt32(&uss.executions[i], 0) > 0 {
 | 
				
			||||||
			uss.expectedExecuting = uss.expectedExecuting + fmt.Sprintf(`				apiserver_flowcontrol_current_executing_requests{flowSchema=%q,priorityLevel=%q} 0%s`, fsName, uss.name, "\n")
 | 
								uss.expectedExecuting = uss.expectedExecuting + fmt.Sprintf(`				apiserver_flowcontrol_current_executing_requests{flow_schema=%q,priority_level=%q} 0%s`, fsName, uss.name, "\n")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if atomic.AddInt32(&uss.rejects[i], 0) > 0 {
 | 
							if atomic.AddInt32(&uss.rejects[i], 0) > 0 {
 | 
				
			||||||
			expectedRejects = expectedRejects + fmt.Sprintf(`				apiserver_flowcontrol_rejected_requests_total{flowSchema=%q,priorityLevel=%q,reason=%q} %d%s`, fsName, uss.name, uss.rejectReason, uss.rejects[i], "\n")
 | 
								expectedRejects = expectedRejects + fmt.Sprintf(`				apiserver_flowcontrol_rejected_requests_total{flow_schema=%q,priority_level=%q,reason=%q} %d%s`, fsName, uss.name, uss.rejectReason, uss.rejects[i], "\n")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if uss.evalExecutingMetrics && len(uss.expectedExecuting) > 0 {
 | 
						if uss.evalExecutingMetrics && len(uss.expectedExecuting) > 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,8 +34,8 @@ const (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	requestKind   = "request_kind"
 | 
						requestKind   = "request_kind"
 | 
				
			||||||
	priorityLevel = "priorityLevel"
 | 
						priorityLevel = "priority_level"
 | 
				
			||||||
	flowSchema    = "flowSchema"
 | 
						flowSchema    = "flow_schema"
 | 
				
			||||||
	phase         = "phase"
 | 
						phase         = "phase"
 | 
				
			||||||
	mark          = "mark"
 | 
						mark          = "mark"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,11 +33,6 @@ var exceptionMetrics = []string{
 | 
				
			|||||||
	// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/egressselector
 | 
						// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/egressselector
 | 
				
			||||||
	"apiserver_egress_dialer_dial_failure_count", // counter metrics should have "_total" suffix
 | 
						"apiserver_egress_dialer_dial_failure_count", // counter metrics should have "_total" suffix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset
 | 
					 | 
				
			||||||
	"apiserver_flowcontrol_current_inqueue_requests",   // label names should be written in 'snake_case' not 'camelCase',
 | 
					 | 
				
			||||||
	"apiserver_flowcontrol_current_executing_requests", // label names should be written in 'snake_case' not 'camelCase'
 | 
					 | 
				
			||||||
	"apiserver_flowcontrol_rejected_requests_total",    // label names should be written in 'snake_case' not 'camelCase'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/healthz
 | 
						// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/healthz
 | 
				
			||||||
	"apiserver_request_total", // label names should be written in 'snake_case' not 'camelCase'
 | 
						"apiserver_request_total", // label names should be written in 'snake_case' not 'camelCase'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,7 @@ const (
 | 
				
			|||||||
	sharedConcurrencyMetricsName      = "apiserver_flowcontrol_request_concurrency_limit"
 | 
						sharedConcurrencyMetricsName      = "apiserver_flowcontrol_request_concurrency_limit"
 | 
				
			||||||
	dispatchedRequestCountMetricsName = "apiserver_flowcontrol_dispatched_requests_total"
 | 
						dispatchedRequestCountMetricsName = "apiserver_flowcontrol_dispatched_requests_total"
 | 
				
			||||||
	rejectedRequestCountMetricsName   = "apiserver_flowcontrol_rejected_requests_total"
 | 
						rejectedRequestCountMetricsName   = "apiserver_flowcontrol_rejected_requests_total"
 | 
				
			||||||
	labelPriorityLevel                = "priorityLevel"
 | 
						labelPriorityLevel                = "priority_level"
 | 
				
			||||||
	timeout                           = time.Second * 10
 | 
						timeout                           = time.Second * 10
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user