test: add e2e test for OpenCensus to OpenTelemetry metrics migration#2055
test: add e2e test for OpenCensus to OpenTelemetry metrics migration#2055khrm wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end test to validate the OpenCensus → OpenTelemetry metrics migration for Tekton Triggers by scraping the controller’s /metrics endpoint and asserting expected metric family presence/prefixes and absence of legacy OpenCensus names.
Changes:
- Introduces a new
TestOTelMetricse2e test that creates minimal Triggers resources (TriggerTemplate/TriggerBinding/EventListener). - Scrapes and parses Prometheus text metrics from the controller (port
9000) via the Kubernetes API proxy and asserts expected metric naming/presence. - Adds explicit checks that legacy OpenCensus workqueue metric names are absent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| t.Run("Renames/workqueue_uses_kn_prefix", func(t *testing.T) { | ||
| found := false | ||
| for name := range families { | ||
| if strings.HasPrefix(name, "kn_workqueue_") { | ||
| found = true | ||
| break | ||
| } | ||
| } | ||
| if !found { | ||
| t.Error("Expected at least one kn_workqueue_* metric, found none") | ||
| } | ||
| }) |
4ecec08 to
6284b15
Compare
6284b15 to
b9a2f8d
Compare
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
b9a2f8d to
3ff6e30
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2055 +/- ##
=======================================
Coverage 31.92% 31.92%
=======================================
Files 260 260
Lines 11966 11966
=======================================
Hits 3820 3820
Misses 7827 7827
Partials 319 319
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds TestOTelMetrics, a consolidated e2e test for the OC→OTel metrics migration in Triggers (PR #1934). The test creates minimal Triggers resources (TriggerTemplate with a TaskRun, TriggerBinding, EventListener) and scrapes the controller /metrics endpoint on port 9000 to assert:
Uses expfmt/dto.MetricFamily for proper Prometheus text parsing against the controller pod's metrics endpoint (port 9000, labeled app.kubernetes.io/part-of=tekton-triggers).
Relates to #1934
Changes
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes