Repository navigation
Replace OpenCensus with OpenTelemetry for metrics - #1
MartinForReal with Copilot wants to merge 186 commits into
Conversation
Removed log message for disabled restart on error.
|
@copilot update the description kubernetes#1210 |
Updated the PR description to match the kubernetes/node-problem-detector PR template format, including the |
|
@copilot no. update the description of pr kubernetes#1210 this pr will be contributed to remote repo. |
I don't have the capability to update PR descriptions on external repositories like kubernetes/node-problem-detector. I can only update the description of this fork's PR. You'll need to manually update PR kubernetes#1210's description on the upstream repository, or you can copy the description I've prepared here to use there. |
|
@copilot build the project and validate the metrics format |
Build and metrics validation completed successfully: Build: ✅ Tests: ✅ All tests pass Metrics Format Validation: ✅ Prometheus metrics exported correctly: OpenTelemetry metadata is properly included ( |
|
@copilot [2] NPD should export Prometheus metrics. |
Fixed in e277f75. The |
|
@copilot push to remote |
I've pushed the fix (4a5e215) to this fork's branch. The issue was that metrics were being created during package init() before the meter provider had the Prometheus exporter attached. I cannot push directly to the upstream kubernetes/node-problem-detector repository. You'll need to sync this fork's changes to your upstream PR kubernetes#1210 manually. |
|
@copilot compare with kubernetes#1141 and see if there is anything missing |
…les/k8s-4c11e3f931 chore(deps): bump the k8s group across 2 directories with 4 updates
…actions/actions-all-ebf40551bc chore(deps): bump the actions-all group with 4 updates
Bumps the actions-all group with 1 update: [step-security/harden-runner](https://github.com/step-security/harden-runner). Updates `step-security/harden-runner` from 2.21.0 to 2.21.1 - [Release notes](https://github.com/step-security/harden-runner/releases) - [Commits](step-security/harden-runner@05e3151...e14015d) --- updated-dependencies: - dependency-name: step-security/harden-runner dependency-version: 2.21.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-all ... Signed-off-by: dependabot[bot] <support@github.com>
…actions/actions-all-4c70b186bc chore(deps): bump step-security/harden-runner from 2.21.0 to 2.21.1 in the actions-all group
Bumps the actions-all group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action). Updates `github/codeql-action/init` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@cdf488f...b96794f) Updates `github/codeql-action/autobuild` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@cdf488f...b96794f) Updates `github/codeql-action/analyze` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@cdf488f...b96794f) Updates `github/codeql-action/upload-sarif` from 4.37.9 to 4.38.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@cdf488f...b96794f) --- updated-dependencies: - dependency-name: github/codeql-action/init dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-all - dependency-name: github/codeql-action/autobuild dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-all - dependency-name: github/codeql-action/analyze dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-all - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-all ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Max Allan <max.allan@chainguard.dev>
Bumps the k8s group with 3 updates in the / directory: [k8s.io/api](https://github.com/kubernetes/api), [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) and [k8s.io/client-go](https://github.com/kubernetes/client-go). Bumps the k8s group with 2 updates in the /test directory: [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) and [k8s.io/component-base](https://github.com/kubernetes/component-base). Updates `k8s.io/api` from 0.37.0 to 0.37.1 - [Commits](kubernetes/api@v0.37.0...v0.37.1) Updates `k8s.io/apimachinery` from 0.37.0 to 0.37.1 - [Commits](kubernetes/apimachinery@v0.37.0...v0.37.1) Updates `k8s.io/client-go` from 0.37.0 to 0.37.1 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.37.0...v0.37.1) Updates `k8s.io/apimachinery` from 0.37.0 to 0.37.1 - [Commits](kubernetes/apimachinery@v0.37.0...v0.37.1) Updates `k8s.io/component-base` from 0.37.0 to 0.37.1 - [Commits](kubernetes/component-base@v0.37.0...v0.37.1) --- updated-dependencies: - dependency-name: k8s.io/api dependency-version: 0.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s - dependency-name: k8s.io/apimachinery dependency-version: 0.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s - dependency-name: k8s.io/client-go dependency-version: 0.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s - dependency-name: k8s.io/apimachinery dependency-version: 0.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s - dependency-name: k8s.io/component-base dependency-version: 0.37.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: k8s ... Signed-off-by: dependabot[bot] <support@github.com>
The kubekins-e2e master image moved to Go 1.27 on 2026-09-08. golangci-lint v2.11.4 is built with Go 1.26 and cannot load the Go 1.27 standard library, so `make fmt` (a prerequisite of `make test` and `make e2e-test`) fails in pull-npd-test, pull-npd-e2e-test and the periodic ci-npd-test: panic: file requires newer Go version go1.27 (application built with go1.26) Switch to v2.14.0, which is built with Go 1.27, and install it from https://golangci-lint.run/install.sh. The install.sh on the golangci-lint master branch is no longer maintained and fails checksum verification for releases >= v2.12.2: its unanchored grep also matches the .sbom.json entry in the checksums file. goconst >= 1.9.0 (bundled since golangci-lint v2.12.0) also inspects composite literals and would report 84 pre-existing string literals, 78 of them in tests. Exclude CompositeLit from goconst so the linting scope stays the same as before. The two formatting changes come from running `make fmt` with the new toolchain (gofmt in Go 1.27 and gofumpt 0.12).
…14.0 Update golangci-lint to v2.14.0 for Go 1.27
Add chainguard to list of OSs
…les/k8s-7ec441f29d chore(deps): bump the k8s group across 2 directories with 4 updates
…actions/actions-all-6b15e67bac chore(deps): bump the actions-all group with 4 updates
go vet flagged e2e/lib/gce/instance.go: non-constant format string in call to fmt.Errorf. Use errors.New for the pre-formatted message.
Bump Go to 1.27.2 and golang.org/x modules
Fixes CVE-2026-84304 (GO-2026-6348), which is reachable through the gRPC client used by the metric exporters, as well as CVE-2026-84445 (GO-2026-6443) and CVE-2026-84303 (GO-2026-6441).
GO-2026-6505: exporter config logging may leak endpoint URLs. Reachable through the OpenTelemetry meter provider initialization.
Fix Go module CVEs found by scanning the post-submit image and branch head
debian-base is only rebuilt on demand, so run apt-get dist-upgrade on top of it to pick up current Debian security updates with every image build. Also install libsystemd0 instead of libsystemd-dev; the runtime image only needs the shared library.
Upgrade Debian packages when building the image
Release v1.38.0-alpha.1
4fbbdf4 to
5e8b123
Compare
Bumps build-image/debian-base from bookworm-v1.0.8 to bookworm-v1.0.9. --- updated-dependencies: - dependency-name: build-image/debian-base dependency-version: bookworm-v1.0.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…build-image/debian-base-bookworm-v1.0.9 chore(deps): bump build-image/debian-base from bookworm-v1.0.8 to bookworm-v1.0.9
Cover a sample line without a # TYPE directive, which the Prometheus text parser treats as an implicitly UNTYPED family, while preserving explicit UNTYPED coverage. Clarify the parser documentation and skip comment so unsupported families are described accurately without changing COUNTER, GAUGE, SUMMARY, or HISTOGRAM handling.
5e8b123 to
d11af79
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
Replaces OpenCensus with OpenTelemetry for metrics instrumentation. OpenCensus has been deprecated and merged into OpenTelemetry, which is now the CNCF standard for observability.
Which issue(s) this PR fixes:
Fixes the need to migrate from deprecated OpenCensus to OpenTelemetry.
Special notes for your reviewer:
Changes
Metrics Package (
pkg/util/metrics/)go.opencensus.io/tag→go.opentelemetry.io/otel/attributego.opencensus.io/stats→go.opentelemetry.io/otel/metricSDKprovider.gofor global MeterProvider managementParsePrometheusMetricsto skip unsupported metric types (SUMMARY, HISTOGRAM) instead of erroringExporters
go.opentelemetry.io/otel/exporters/prometheusinstead of OpenCensus contrib exporterWithTranslationStrategy(otlptranslator.UnderscoreEscapingWithoutSuffixes)to prevent adding_ratioor_totalsuffixesWithoutScopeInfo()to prevent addingotel_scope_*labelsgithub.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metricinstead of OpenCensus contrib exporterInitialization Order Fix
SetupMeterProvider()is calledproblemmetrics.GlobalProblemMetricsManageruses lazy initialization to defer metric creationDependencies
go.opencensus.io,contrib.go.opencensus.io/*go.opentelemetry.io/otel/sdk/metric,go.opentelemetry.io/otel/exporters/prometheusgithub.com/prometheus/otlptranslatorto direct dependency (used forWithTranslationStrategy)API Unchanged
The wrapper API remains identical:
Internally,
LastValueaggregation maps to OTel gauges,Summaps to OTel counters.Does this PR introduce a user-facing change?
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.