Skip to content

Commit 2690fe8

Browse files
committed
feat: Migrate PipelineRun and TaskRun metrics to OpenTelemetry
This commit migrates the metrics for PipelineRuns and TaskRuns from OpenCensus to OpenTelemetry. The following changes are included: - Updated the observability config to support OpenTelemetry. - Migrated the implementation of PipelineRun and TaskRun metrics to use the OpenTelemetry Go SDK. - Updated the tests to work with the new OpenTelemetry-based implementation.
1 parent a2871f3 commit 2690fe8

File tree

6 files changed

+760
-1926
lines changed

6 files changed

+760
-1926
lines changed

config/config-observability.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24+
metrics-protocol: prometheus
2425
_example: |
2526
################################
2627
# #
@@ -37,6 +38,43 @@ data:
3738
# this example block and unindented to be in the data block
3839
# to actually change the configuration.
3940
41+
# OpenTelemetry Metrics Configuration
42+
# Protocol for metrics export (prometheus, grpc, http/protobuf, none)
43+
# Default: prometheus
44+
metrics-protocol: prometheus
45+
46+
# Metrics endpoint (for grpc/http protocols)
47+
# Default: empty (uses default OTLP endpoint)
48+
metrics-endpoint: ""
49+
50+
# Metrics export interval (e.g., "30s", "1m")
51+
# Default: empty (uses default interval)
52+
metrics-export-interval: ""
53+
54+
# OpenTelemetry Tracing Configuration
55+
# Protocol for tracing export (grpc, http/protobuf, none, stdout)
56+
# Default: none
57+
tracing-protocol: none
58+
59+
# Tracing endpoint (for grpc/http protocols)
60+
# Default: empty
61+
tracing-endpoint: ""
62+
63+
# Tracing sampling rate (0.0 to 1.0)
64+
# Default: 1.0 (100% sampling)
65+
tracing-sampling-rate: "1.0"
66+
67+
# Runtime Configuration
68+
# Enable profiling (enabled, disabled)
69+
# Default: disabled
70+
runtime-profiling: disabled
71+
72+
# Runtime export interval (e.g., "15s")
73+
# Default: 15s
74+
runtime-export-interval: "15s"
75+
76+
# Legacy OpenCensus Configuration (DEPRECATED)
77+
# These are kept for backward compatibility but should be migrated to OpenTelemetry
4078
# metrics.backend-destination field specifies the system metrics destination.
4179
# It supports either prometheus (the default) or stackdriver.
4280
# Note: Using Stackdriver will incur additional charges.
@@ -54,9 +92,11 @@ data:
5492
# charge. If metrics.backend-destination is not Stackdriver, this is
5593
# ignored.
5694
metrics.allow-stackdriver-custom-metrics: "false"
95+
96+
# Tekton-specific metrics configuration
5797
metrics.taskrun.level: "task"
5898
metrics.taskrun.duration-type: "histogram"
5999
metrics.pipelinerun.level: "pipeline"
60100
metrics.pipelinerun.duration-type: "histogram"
61101
metrics.count.enable-reason: "false"
62-
metrics.running-pipelinerun.level: ""
102+
metrics.running-pipelinerun.level: ""

0 commit comments

Comments
 (0)