Commit graph

146 commits

Author SHA1 Message Date
Prince Pereira
62f1d9062c Add Prometheus metrics for KubeProxy failed loadbalancer operations 2026-06-09 20:30:36 +00:00
Davanum Srinivas
73cabc240f
Bump go.opentelemetry.io/otel to v1.44.0
Update the OpenTelemetry core module (which provides the propagation and
baggage packages) and its sibling modules from v1.43.0 to v1.44.0:

- go.opentelemetry.io/otel v1.43.0 -> v1.44.0
- go.opentelemetry.io/otel/metric v1.43.0 -> v1.44.0
- go.opentelemetry.io/otel/sdk v1.43.0 -> v1.44.0
- go.opentelemetry.io/otel/trace v1.43.0 -> v1.44.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 -> v1.44.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 -> v1.44.0

Transitive updates pulled in by the bump:

- google.golang.org/grpc v1.81.0 -> v1.81.1
- google.golang.org/genproto/googleapis/{api,rpc} -> 20260526163538-3dc84a4a5aaa

Vendor regenerated via hack/update-vendor.sh. hack/lint-dependencies.sh and
hack/verify-typecheck.sh pass; no changes required to unwanted-dependencies.json.
2026-05-29 14:38:46 -04:00
Maciej Skoczeń
8eb66b73ef Add support for PodGroups in scheduling queue 2026-05-27 13:06:13 +00:00
Kubernetes Prow Robot
870565d371
Merge pull request #139311 from SergeyKanzhelev/rename-sort-to-metric-sort
Rename instrumentation sort tool to metric-sort and stop installing it
2026-05-27 06:05:58 +05:30
Sergey Kanzhelev
faa4a90f18 Rename instrumentation sort tool to metric-sort and stop installing it
The sort tool in hack/tools/instrumentation/sort/ shadows /usr/bin/sort
when installed into GOBIN. Scripts like hack/verify-deadcode-elimination.sh
prepend GOBIN to PATH, causing the coreutil sort to be replaced by this
Go binary, which breaks unrelated verifiers.

The tool is not used by any automation, so remove it from the install
line. Also rename the directory from sort/ to metric-sort/ to prevent
future accidental PATH shadowing.
2026-05-26 13:11:19 -07:00
YeRongyu
48adfae81d deprecate(apiserver): deprecate cache list metrics 2026-05-23 11:59:50 +08:00
Kubernetes Prow Robot
f6442409ad
Merge pull request #139248 from dims/bump-golang.org/x/crypto-to-v0.52.0
Bump golang.org/x/crypto to v0.52.0
2026-05-23 00:05:00 +05:30
Kubernetes Prow Robot
ec60a1daf8
Merge pull request #136894 from LoginovIlia/apiserver_util_metrics_beta
Update util metrics to beta
2026-05-22 23:10:44 +05:30
Davanum Srinivas
17a8f4f5c0
Bump golang.org/x/crypto to v0.52.0 2026-05-22 12:13:09 -04:00
ChengHao Yang
db24241465
Update stable-metrics-list.yaml for watch_events_sizes and watch_events_total
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-05-22 10:29:05 +08:00
ChengHao Yang
cbc3343f65
Update instrumentation docs list
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-05-22 10:29:05 +08:00
LoginovIlia
23f20d1980 Graduate metrics for connection failures caused by missing X509 or SHA1 certificates from alpha to beta and add tests to validate the behavior 2026-05-21 11:05:57 -04:00
ChengHao Yang
63928fb1ce
Graduate old SA metric update stable-metrics-list.yaml
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-05-20 15:55:07 +08:00
ChengHao Yang
db4ea8afdb
Graduate old SA metric update documentation-list.yaml
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-05-20 15:55:06 +08:00
Kubernetes Prow Robot
04976d6f60
Merge pull request #138844 from skitt/bump-tools
Bump all tool dependencies
2026-05-20 01:31:45 +05:30
Richa Banker
f9ab2ff915 add CI verification for metrics documentation list
Signed-off-by: Richa Banker <richabanker@google.com>
2026-05-18 13:24:09 -07:00
Richa Banker
b05227901a [metrics docs]: use prefix match for component mapping 2026-05-15 14:48:14 -07:00
Jordan Liggitt
8bfe33092a
Bump sigs.k8s.io/kube-api-linter 2026-05-13 11:20:23 -04:00
Stephen Kitt
b5ca9696ea
Bump gotest.tools/gotestsum
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
583376ca2a
Bump google.golang.org/grpc/cmd/protoc-gen-go-grpc
This produces more readable raw descriptions.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
1d193ca8ff
Bump golang.org/x/mod/modfile
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
e223a05ec7
Bump github.com/vektra/mockery/v3
mockery ignores auto-generated code by default, so this requires a
couple of configuration changes.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
b7d0bea934
Bump github.com/jcchavezs/porto/cmd/porto
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
7f5209efd2
Bump github.com/golangci/misspell
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
8be5e8aac7
Bump github.com/cespare/prettybench
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Stephen Kitt
0d70476951
Bump github.com/aojea/sloppy-netparser
Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:37 +02:00
Kubernetes Prow Robot
f830e4a2b8
Merge pull request #138542 from pohly/dra-create-resource-claim
DRA: harmonize ResourceClaim creation metric
2026-05-12 05:12:09 +05:30
Kubernetes Prow Robot
4cfd7e74b1
Merge pull request #138628 from richabanker/metrics-docs-update-1.36
Make metric doc generation order-stable and update metrics docs for v1.36
2026-05-12 01:01:49 +05:30
Patrick Ohly
4a305f8fc7 DRA: fix component list for ResourceClaim metric
The endpoint-mappings.yaml file specifies which components use which
metrics. The case some, but not all core components (kube-controller-manager
and kube-scheduler in this case) sharing the same metrics was not
supported. This gets fixed by not returning early once the first file path
matches.

Not all metrics in pkg/controller/resourceclaim/metrics are shared. To make the
sharing clearer and fit into the file-path based component support in
endpoint-mappings.yaml, the shared metric gets moved to a new
pkg/resourceclaim/metrics package.
2026-05-11 12:31:45 +02:00
Stephen Kitt
a43aad2e83
tools: drop staticcheck
A newer version of staticcheck is available through golangci-lint, and
that is what the project is using. The direct dependency in tools is
unnecessary, this removes that.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-11 09:28:41 +02:00
Richa Banker
e8aa50b0b7 Update metrics docs for v1.36
Signed-off-by: Richa Banker <richabanker@google.com>
2026-05-08 17:21:19 -07:00
Stephen Kitt
edf0df348c
Bump go.yaml.in/yaml/v2 to 2.4.4
This only changes tests to drop gopkg.in/check.v1, which helps our
dependency tree a little.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-06 18:24:52 +02:00
Prathamesh Bhope
610e615b35 Promote volume metrics to beta and strengthen the tests 2026-05-05 10:48:17 -07:00
Kubernetes Prow Robot
9268179b80
Merge pull request #137105 from pohly/test-upstream-unit-tests
test: support running upstream unit tests
2026-05-01 23:49:24 +05:30
Patrick Ohly
88391f7653 instrumentation test: fix unit test
Moving the code made it impossible to import pkg/kubelet/metrics.
But all that the test needs is the subsystem name, so importing
the package can be avoided.
2026-04-27 09:18:11 +02:00
Davanum Srinivas
12a2470693
Update golang.org/x/net to v0.53.0
Fixes CVE-2026-33814 (golang/go#78476): HTTP/2 Transport hangs
indefinitely when a peer sends a SETTINGS frame with MaxFrameSize=0.
This is reachable from kube-apiserver's OIDC, admission webhook,
and aggregated API client paths.
2026-04-23 21:36:05 -04:00
Stephen Kitt
1a63916abe
Bump otel to 1.43.0 and contrib to 0.68.0
See
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.43.0
and
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.43.0
for details.

otelgrpc no longer produces "messages" span events so these are
removed from the tracing test.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-04-23 14:35:21 +02:00
David Ashpole
28a48c318f
add presubmit for metric naming 2026-04-21 01:03:31 +00:00
Patrick Ohly
5782e1e26d hack/tools: bump golangci-lint to v2.11.2
Among other updates and features this brings
https://github.com/nunnatsa/ginkgolinter/pull/224 into Kubernetes.
2026-03-09 10:24:31 +01:00
Jordan Liggitt
f291ae40b0
Bump to go 1.26 2026-03-05 16:48:18 -05:00
Patrick Ohly
b895ce734f golangci-lint: bump to logtools v0.10.1
This fixes a bug that caused log calls involving `klog.Logger` to not be
checked.

As a result we have to fix some code that is now considered faulty:

    ERROR: pkg/controller/serviceaccount/tokens_controller.go:382:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (e *TokensController) generateTokenIfNeeded(ctx context.Context, logger klog.Logger, serviceAccount *v1.ServiceAccount, cachedSecret *v1.Secret) ( /* retry */ bool, error) {
    ERROR: ^
    ERROR: pkg/controller/storageversionmigrator/storageversionmigrator.go:299:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (svmc *SVMController) runMigration(ctx context.Context, logger klog.Logger, gvr schema.GroupVersionResource, resourceMonitor *garbagecollector.Monitor, toBeProcessedSVM *svmv1beta1.StorageVersionMigration, listResourceVersion string) (err error, failed bool) {
    ERROR: ^
    ERROR: pkg/proxy/node.go:121:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to exist", nodeName)
    ERROR: 		^
    ERROR: pkg/proxy/node.go:123:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to be assigned IPs", nodeName)
    ERROR: 		^
    ERROR: pkg/scheduler/backend/queue/scheduling_queue.go:610:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, logger klog.Logger, pl fwk.PreEnqueuePlugin, pInfo *framework.QueuedPodInfo, shouldRecordMetric bool) *fwk.Status {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:286:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) deleteClaim(ctx context.Context, claim *resourceapi.ResourceClaim, logger klog.Logger) error {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:499:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) waitForExtendedClaimInAssumeCache(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:528:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) createExtendedResourceClaimInAPI(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:592:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) unreserveExtendedResourceClaim(ctx context.Context, logger klog.Logger, pod *v1.Pod, state *stateData) {
    ERROR: ^
    ERROR: pkg/scheduler/framework/runtime/batch.go:171:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (b *OpportunisticBatch) batchStateCompatible(ctx context.Context, logger klog.Logger, pod *v1.Pod, signature fwk.PodSignature, cycleCount int64, state fwk.CycleState, nodeInfos fwk.NodeInfoLister) bool {
    ERROR: ^
    ERROR: staging/src/k8s.io/component-base/featuregate/feature_gate.go:890:4: Additional arguments to Info should always be Key Value pairs. Please check if there is any key or value missing. (logcheck)
    ERROR: 			logger.Info("Warning: SetEmulationVersionAndMinCompatibilityVersion will change already queried feature", "featureGate", feature, "oldValue", oldVal, newVal)
    ERROR: 			^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:108:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("pluginSocksDir: %s", pluginSocksDir)
    ERROR: 	^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:123:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("CDI_ENABLED: %s", cdiEnabled)
    ERROR: 	^

While waiting for this to merge, another call was added which also doesn't
follow conventions:

    ERROR: pkg/kubelet/kubelet.go:2454:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (kl *Kubelet) deletePod(ctx context.Context, logger klog.Logger, pod *v1.Pod) error {
    ERROR: ^

Contextual logging has been beta and enabled by default for several releases
now. It's mostly just a matter of wrapping up and declaring it GA. Therefore
the calls which directly call WithName or WithValues (always have an effect)
are left as-is instead of converting them to use the klog wrappers (support
disabling the effect). To allow that, the linter gets reconfigured to not
complain about this anymore, anywhere.

The calls which would have to be fixed otherwise are:

    ERROR: pkg/kubelet/cm/dra/claiminfo.go:170:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-claiminfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:45:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:89:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:157:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/manager.go:175:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:239:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:593:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:781:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(context.Background()).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:898:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager_test.go:1638:15: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 				logger := klog.FromContext(streamCtx).WithName(st.Name())
    ERROR: 				          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:77:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:108:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:161:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go:695:14: function "WithValues" should be called through klogr.LoggerWithValues (logcheck)
    ERROR: 			logger := logger.WithValues("device", deviceID)
    ERROR: 			          ^
    ERROR: test/integration/apiserver/watchcache_test.go:42:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd0URL, stopEtcd0, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd0"), "etcd_watchcache0", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/apiserver/watchcache_test.go:47:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd1URL, stopEtcd1, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd1"), "etcd_watchcache1", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/scheduler_perf/scheduler_perf.go:1149:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 		logger = logger.WithName(tCtx.Name())
    ERROR: 		         ^
2026-03-04 12:08:18 +01:00
Stephen Kitt
3d1e90f95a
Bump to golangci-lint 2.9.0
bloop was disabled because of its impact on small benchmarks (see
267fc6b81a
for details), this removes it from the disabled entries.

stringscut was introduced in x/tools 0.40.0 and is disabled for
existing code.

ginkgolinter's Success matcher check doesn't know about TContext, so
it's disabled for k/k.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-02-16 15:45:22 +01:00
Patrick Ohly
391a58ce24 test dependencies: logtools v0.10.0
The update logcheck linter will warn about logger.V().Error by default. Such
calls make no sense because logr by design treats this like logger.Error. In
Kubernetes, they tend to be the result of an incorrect conversion of
klog.V().Error[S], which does check the verbosity. With logger, Error needs to
be replaced by Info.
2026-01-16 18:44:21 +01:00
yongruilin
37e05b74c7 update sigs.k8s.io/kube-api-linter to latest 2026-01-14 20:02:30 +00:00
Joel Speed
456c13b409
Update Kube API Linter 2025-12-19 14:57:23 +00:00
Patrick Ohly
6bcb5beba3 golangci-lint: bump to v2.7.1 2025-12-18 12:10:15 +01:00
Kevin Hannon
fda069a5d6 update kal to fix markdown table bug 2025-10-30 12:01:09 -04:00
yongruilin
12b5106809 bump kube-api-linter tool to latest and go mod tidy 2025-10-22 18:02:06 +00:00
Stephen Kitt
c3a26a066d
Bump golangci-lint to 2.4.0
This adds support for Go 1.25. There are no changes to the linting
results.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-09-18 16:20:34 +02:00
Benjamin Elder
88d6e6c465 drop automaxprocs hacks now that go 1.25 handles this built in
https://go.dev/doc/go1.25#container-aware-gomaxprocs
2025-09-17 16:36:15 -07:00