Skip to content

feat(metrics): Migrate from OpenCensus to OpenTelemetry#1550

Open
anithapriyanatarajan wants to merge 1 commit intotektoncd:mainfrom
anithapriyanatarajan:upgrade-otel
Open

feat(metrics): Migrate from OpenCensus to OpenTelemetry#1550
anithapriyanatarajan wants to merge 1 commit intotektoncd:mainfrom
anithapriyanatarajan:upgrade-otel

Conversation

@anithapriyanatarajan
Copy link
Contributor

@anithapriyanatarajan anithapriyanatarajan commented Feb 9, 2026

Fixes issue: #1355

Changes

This PR Migrates Chains metrics implementation from the deprecated OpenCensus library to OpenTelemetry to align with Tekton Pipeline and Knative's observability stack modernization.

This migration is necessary because:

  • Knative deprecated knative.dev/pkg/metrics (OpenCensus-based) and removed it from the latest versions
  • Knative introduced knative.dev/pkg/observability with OpenTelemetry support as the replacement metrics framework
  • Tekton Pipeline is migrating to OpenTelemetry (PR #9043)
  • OpenCensus is no longer maintained and the ecosystem has standardize on OpenTelemetry

Changes include:

  • Update knative.dev/pkg to v0.0.0-20260120122510-4a022ed9999a (includes new observability package with OpenTelemetry support)
  • Update tektoncd/pipeline dependency to PR #9043 commit (f8f832f42539) for OpenTelemetry compatibility
  • Replace deprecated knative.dev/pkg/metrics imports with direct OpenTelemetry (go.opentelemetry.io/otel) in pkg/pipelinerunmetrics and pkg/taskrunmetrics
  • Convert OpenCensus stats.Float64Measure and view.View to OpenTelemetry Int64Counter instruments
  • Update metric recording from metrics.Record() with tags to OTel's Counter.Add() with attributes
  • Simplify tests to work without deprecated knative.dev/pkg/metrics/metricstest

The metrics API exposed by Chains remains unchanged - this is an internal implementation migration. All existing metrics (pipelinerun_sign_created_total,taskrun_payload_uploaded_total, etc.) continue to be exported with the same
names and labels.

Relates to tektoncd/pipeline#9043
Relates to knative/serving observability migration: https://knative.dev/docs/serving/observability/metrics/serving-metrics/

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

 Migrated from deprecated OpenCensus to OpenTelemetry for metrics collection due to Knative's deprecation of their OpenCensus-based metrics package.

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 9, 2026
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from anithapriyanatarajan after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 9, 2026
@anithapriyanatarajan anithapriyanatarajan added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 9, 2026
@tekton-robot
Copy link

@anithapriyanatarajan: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants