Skip to content

Commit ab52897

Browse files
committed
Migrate from OpenCensus to Otel using knative
1 parent 6e9b04d commit ab52897

File tree

15 files changed

+745
-1990
lines changed

15 files changed

+745
-1990
lines changed

config/config-observability.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,47 @@ 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.
43-
metrics.backend-destination: prometheus
80+
metrics-protocol: prometheus
4481
4582
# metrics.stackdriver-project-id field specifies the Stackdriver project ID. This
4683
# field is optional. When running on GCE, application default credentials will be
@@ -54,6 +91,8 @@ 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"

config/resolvers/config-observability.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,43 @@ data:
3939
# this example block and unindented to be in the data block
4040
# to actually change the configuration.
4141
42+
# OpenTelemetry Metrics Configuration
43+
# Protocol for metrics export (prometheus, grpc, http/protobuf, none)
44+
# Default: prometheus
45+
metrics-protocol: prometheus
46+
47+
# Metrics endpoint (for grpc/http protocols)
48+
# Default: empty (uses default OTLP endpoint)
49+
metrics-endpoint: ""
50+
51+
# Metrics export interval (e.g., "30s", "1m")
52+
# Default: empty (uses default interval)
53+
metrics-export-interval: ""
54+
55+
# OpenTelemetry Tracing Configuration
56+
# Protocol for tracing export (grpc, http/protobuf, none, stdout)
57+
# Default: none
58+
tracing-protocol: none
59+
60+
# Tracing endpoint (for grpc/http protocols)
61+
# Default: empty
62+
tracing-endpoint: ""
63+
64+
# Tracing sampling rate (0.0 to 1.0)
65+
# Default: 1.0 (100% sampling)
66+
tracing-sampling-rate: "1.0"
67+
68+
# Runtime Configuration
69+
# Enable profiling (enabled, disabled)
70+
# Default: disabled
71+
runtime-profiling: disabled
72+
73+
# Runtime export interval (e.g., "15s")
74+
# Default: 15s
75+
runtime-export-interval: "15s"
76+
77+
# Legacy OpenCensus Configuration (DEPRECATED)
78+
# These are kept for backward compatibility but should be migrated to OpenTelemetry
4279
# metrics.backend-destination field specifies the system metrics destination.
4380
# It supports either prometheus (the default) or stackdriver.
4481
# Note: Using stackdriver will incur additional charges

pkg/apis/config/testdata/config-observability-empty.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24-
metrics.backend-destination: prometheus
25-
metrics.stackdriver-project-id: "<your stackdriver project id>"
26-
metrics.allow-stackdriver-custom-metrics: "false"
24+
# OpenTelemetry Metrics Configuration
25+
metrics-protocol: prometheus
26+
metrics-endpoint: ""
27+
metrics-export-interval: ""
28+
29+
# OpenTelemetry Tracing Configuration
30+
tracing-protocol: none
31+
tracing-endpoint: ""
32+
tracing-sampling-rate: "1.0"
33+
34+
# Runtime Configuration
35+
runtime-profiling: disabled
36+
runtime-export-interval: "15s"

pkg/apis/config/testdata/config-observability-namespacelevel.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24+
# OpenTelemetry Metrics Configuration
25+
metrics-protocol: prometheus
26+
metrics-endpoint: ""
27+
metrics-export-interval: ""
28+
29+
# OpenTelemetry Tracing Configuration
30+
tracing-protocol: none
31+
tracing-endpoint: ""
32+
tracing-sampling-rate: "1.0"
33+
34+
# Runtime Configuration
35+
runtime-profiling: disabled
36+
runtime-export-interval: "15s"
37+
38+
# Legacy OpenCensus Configuration (for backward compatibility)
2439
metrics.backend-destination: prometheus
25-
metrics.stackdriver-project-id: "<your stackdriver project id>"
26-
metrics.allow-stackdriver-custom-metrics: "false"
40+
41+
# Tekton-specific metrics configuration (current implementation expects these)
2742
metrics.taskrun.level: "namespace"
2843
metrics.taskrun.duration-type: "histogram"
2944
metrics.pipelinerun.level: "namespace"
30-
metrics.running-pipelinerun.level: "namespace"
3145
metrics.pipelinerun.duration-type: "lastvalue"
46+
metrics.running-pipelinerun.level: "namespace"

pkg/apis/config/testdata/config-observability-reason.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,26 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24+
# OpenTelemetry Metrics Configuration
25+
metrics-protocol: prometheus
26+
metrics-endpoint: ""
27+
metrics-export-interval: ""
28+
29+
# OpenTelemetry Tracing Configuration
30+
tracing-protocol: none
31+
tracing-endpoint: ""
32+
tracing-sampling-rate: "1.0"
33+
34+
# Runtime Configuration
35+
runtime-profiling: disabled
36+
runtime-export-interval: "15s"
37+
38+
# Legacy OpenCensus Configuration (for backward compatibility)
2439
metrics.backend-destination: prometheus
2540
metrics.stackdriver-project-id: "<your stackdriver project id>"
2641
metrics.allow-stackdriver-custom-metrics: "false"
42+
43+
# Tekton-specific metrics configuration (current implementation expects these)
2744
metrics.taskrun.level: "namespace"
2845
metrics.taskrun.duration-type: "histogram"
2946
metrics.pipelinerun.level: "namespace"

pkg/apis/config/testdata/config-observability-throttle.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,26 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24+
# OpenTelemetry Metrics Configuration
25+
metrics-protocol: prometheus
26+
metrics-endpoint: ""
27+
metrics-export-interval: ""
28+
29+
# OpenTelemetry Tracing Configuration
30+
tracing-protocol: none
31+
tracing-endpoint: ""
32+
tracing-sampling-rate: "1.0"
33+
34+
# Runtime Configuration
35+
runtime-profiling: disabled
36+
runtime-export-interval: "15s"
37+
38+
# Legacy OpenCensus Configuration (for backward compatibility)
2439
metrics.backend-destination: prometheus
2540
metrics.stackdriver-project-id: "<your stackdriver project id>"
2641
metrics.allow-stackdriver-custom-metrics: "false"
42+
43+
# Tekton-specific metrics configuration (current implementation expects these)
2744
metrics.taskrun.level: "namespace"
2845
metrics.taskrun.duration-type: "histogram"
2946
metrics.pipelinerun.level: "namespace"

pkg/apis/config/testdata/config-observability.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,26 @@ metadata:
2121
app.kubernetes.io/instance: default
2222
app.kubernetes.io/part-of: tekton-pipelines
2323
data:
24+
# OpenTelemetry Metrics Configuration
25+
metrics-protocol: prometheus
26+
metrics-endpoint: ""
27+
metrics-export-interval: ""
28+
29+
# OpenTelemetry Tracing Configuration
30+
tracing-protocol: none
31+
tracing-endpoint: ""
32+
tracing-sampling-rate: "1.0"
33+
34+
# Runtime Configuration
35+
runtime-profiling: disabled
36+
runtime-export-interval: "15s"
37+
38+
# Legacy OpenCensus Configuration (for backward compatibility)
2439
metrics.backend-destination: prometheus
2540
metrics.stackdriver-project-id: "<your stackdriver project id>"
2641
metrics.allow-stackdriver-custom-metrics: "false"
42+
43+
# Tekton-specific metrics configuration
2744
metrics.taskrun.level: "taskrun"
2845
metrics.taskrun.duration-type: "histogram"
2946
metrics.pipelinerun.level: "pipelinerun"

0 commit comments

Comments
 (0)