Skip to content

Commit 99d4286

Browse files
committed
feat(metrics): Migrate to OpenTelemetry for metrics
This commit migrates the metrics collection from OpenCensus to OpenTelemetry, aligning with the broader observability trends in the ecosystem. Key changes include: - Updated `pipelinerunmetrics` and `taskrunmetrics` to use the OpenTelemetry SDK for creating and recording metrics. - Preserved existing metric names and labels to ensure backward compatibility with existing dashboards and alerting. - Updated `config-observability.yaml` to use the new OpenTelemetry configuration for exporting metrics. - Updated `docs/metrics.md` to reflect the new configuration options. - Removed the now-obsolete OpenCensus `unregisterMetrics` function from the test suite. All changes have been verified with the existing test suite.
1 parent 0161399 commit 99d4286

File tree

5 files changed

+500
-1955
lines changed

5 files changed

+500
-1955
lines changed

config/config-observability.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,43 @@ data:
3737
# this example block and unindented to be in the data block
3838
# to actually change the configuration.
3939
40+
# OpenTelemetry Metrics Configuration
41+
# Protocol for metrics export (prometheus, grpc, http/protobuf, none)
42+
# Default: prometheus
43+
metrics-protocol: prometheus
44+
45+
# Metrics endpoint (for grpc/http protocols)
46+
# Default: empty (uses default OTLP endpoint)
47+
metrics-endpoint: ""
48+
49+
# Metrics export interval (e.g., "30s", "1m")
50+
# Default: empty (uses default interval)
51+
metrics-export-interval: ""
52+
53+
# OpenTelemetry Tracing Configuration
54+
# Protocol for tracing export (grpc, http/protobuf, none, stdout)
55+
# Default: none
56+
tracing-protocol: none
57+
58+
# Tracing endpoint (for grpc/http protocols)
59+
# Default: empty
60+
tracing-endpoint: ""
61+
62+
# Tracing sampling rate (0.0 to 1.0)
63+
# Default: 1.0 (100% sampling)
64+
tracing-sampling-rate: "1.0"
65+
66+
# Runtime Configuration
67+
# Enable profiling (enabled, disabled)
68+
# Default: disabled
69+
runtime-profiling: disabled
70+
71+
# Runtime export interval (e.g., "15s")
72+
# Default: 15s
73+
runtime-export-interval: "15s"
74+
75+
# Legacy OpenCensus Configuration (DEPRECATED)
76+
# These are kept for backward compatibility but should be migrated to OpenTelemetry
4077
# metrics.backend-destination field specifies the system metrics destination.
4178
# It supports either prometheus (the default) or stackdriver.
4279
# Note: Using Stackdriver will incur additional charges.
@@ -54,9 +91,11 @@ data:
5491
# charge. If metrics.backend-destination is not Stackdriver, this is
5592
# ignored.
5693
metrics.allow-stackdriver-custom-metrics: "false"
94+
95+
# Tekton-specific metrics configuration
5796
metrics.taskrun.level: "task"
5897
metrics.taskrun.duration-type: "histogram"
5998
metrics.pipelinerun.level: "pipeline"
6099
metrics.pipelinerun.duration-type: "histogram"
61100
metrics.count.enable-reason: "false"
62-
metrics.running-pipelinerun.level: ""
101+
metrics.running-pipelinerun.level: ""

0 commit comments

Comments
 (0)