Skip to content

Commit 424e718

Browse files
Otel integration (#180)
* feat(telemetry): integrate OpenTelemetry for metrics collection and monitoring - Added OpenTelemetry configuration and support in main application. - Introduced telemetry metrics setup with flags for enabling/disabling telemetry and configuring export intervals. - Created Grafana dashboard JSON for visualizing metrics related to the composition dynamic controller. - Added OpenTelemetry Collector configuration files for metrics scraping and exporting to Prometheus. - Included metrics reference documentation detailing available metrics and their usage. - Implemented telemetry in the composition handler for enhanced observability. * fix: update query for deployment resource in dashboard to reflect in-flight reconciliations * feat: new cdc specific metrics (rbac generation and helm related) and code fixing/alignment * chore: update dependencies for plumbing and spdystream; add OpenTelemetry packages * fix: remove local replacement for unstructured-runtime and update go.sum
1 parent a68eb2e commit 424e718

16 files changed

Lines changed: 2206 additions & 102 deletions

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,6 @@ These enviroment varibles can be changed in the Deployment of the composition-dy
282282
| COMPOSITION_CONTROLLER_MAX_ERROR_RETRIES | The maximum number of retries when an error occurs. Set to 0 to disable retries. | 5 |
283283
| COMPOSITION_CONTROLLER_METRICS_SERVER_PORT | The port where the metrics server will be listening. If not set, the metrics server is disabled. | |
284284
| COMPOSITION_CONTROLLER_SAFE_RELEASE_NAME | If disabled the randmom suffix is not appended in the Helm release name. This can be useful for avoid having problems with complex helm charts. The use of this option is highly discouraged, as it can lead to release name collisions. | true |
285+
| OTEL_ENABLED | Enable OpenTelemetry metrics export | false |
286+
| OTEL_EXPORTER_OTLP_ENDPOINT | OTLP HTTP endpoint where metrics are sent | `http://localhost:4318` |
287+
| OTEL_EXPORT_INTERVAL | Interval at which metrics are exported | 30s |

go.mod

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ require (
66
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
77
github.com/go-logr/logr v1.4.3
88
github.com/gobuffalo/flect v1.0.3
9-
github.com/krateoplatformops/plumbing v1.7.2
10-
github.com/krateoplatformops/unstructured-runtime v1.0.1
9+
github.com/krateoplatformops/plumbing v1.7.3
10+
github.com/krateoplatformops/unstructured-runtime v1.1.0
1111
github.com/stretchr/testify v1.11.1
12-
k8s.io/api v0.35.2
12+
go.opentelemetry.io/otel v1.43.0
13+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0
14+
go.opentelemetry.io/otel/metric v1.43.0
15+
go.opentelemetry.io/otel/sdk v1.43.0
16+
go.opentelemetry.io/otel/sdk/metric v1.43.0
17+
k8s.io/api v0.35.3
1318
k8s.io/apiextensions-apiserver v0.35.1
14-
k8s.io/apimachinery v0.35.2
15-
k8s.io/client-go v0.35.2
19+
k8s.io/apimachinery v0.35.3
20+
k8s.io/client-go v0.35.3
1621
sigs.k8s.io/e2e-framework v0.6.0
1722
)
1823

@@ -28,6 +33,7 @@ require (
2833
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
2934
github.com/beorn7/perks v1.0.1 // indirect
3035
github.com/blang/semver/v4 v4.0.0 // indirect
36+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
3137
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3238
github.com/chai2010/gettext-go v1.0.2 // indirect
3339
github.com/containerd/containerd v1.7.30 // indirect
@@ -44,6 +50,7 @@ require (
4450
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
4551
github.com/go-errors/errors v1.5.1 // indirect
4652
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
53+
github.com/go-logr/stdr v1.2.2 // indirect
4754
github.com/go-openapi/jsonpointer v0.21.1 // indirect
4855
github.com/go-openapi/jsonreference v0.21.0 // indirect
4956
github.com/go-openapi/swag v0.23.1 // indirect
@@ -56,6 +63,7 @@ require (
5663
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
5764
github.com/gosuri/uitable v0.0.4 // indirect
5865
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
66+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
5967
github.com/hashicorp/errwrap v1.1.0 // indirect
6068
github.com/hashicorp/go-multierror v1.1.1 // indirect
6169
github.com/huandu/xstrings v1.5.0 // indirect
@@ -75,7 +83,7 @@ require (
7583
github.com/mitchellh/copystructure v1.2.0 // indirect
7684
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
7785
github.com/mitchellh/reflectwalk v1.0.2 // indirect
78-
github.com/moby/spdystream v0.5.0 // indirect
86+
github.com/moby/spdystream v0.5.1 // indirect
7987
github.com/moby/term v0.5.2 // indirect
8088
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
8189
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
@@ -105,21 +113,23 @@ require (
105113
github.com/vladimirvivien/gexe v0.4.1 // indirect
106114
github.com/x448/float16 v0.8.4 // indirect
107115
github.com/xlab/treeprint v1.2.0 // indirect
108-
go.opentelemetry.io/otel v1.37.0 // indirect
109-
go.opentelemetry.io/otel/trace v1.37.0 // indirect
116+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
117+
go.opentelemetry.io/otel/trace v1.43.0 // indirect
118+
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
110119
go.yaml.in/yaml/v2 v2.4.3 // indirect
111120
go.yaml.in/yaml/v3 v3.0.4 // indirect
112-
golang.org/x/crypto v0.46.0 // indirect
113-
golang.org/x/net v0.48.0 // indirect
114-
golang.org/x/oauth2 v0.30.0 // indirect
115-
golang.org/x/sync v0.19.0 // indirect
116-
golang.org/x/sys v0.40.0 // indirect
117-
golang.org/x/term v0.39.0 // indirect
118-
golang.org/x/text v0.33.0 // indirect
121+
golang.org/x/crypto v0.49.0 // indirect
122+
golang.org/x/net v0.52.0 // indirect
123+
golang.org/x/oauth2 v0.35.0 // indirect
124+
golang.org/x/sync v0.20.0 // indirect
125+
golang.org/x/sys v0.42.0 // indirect
126+
golang.org/x/term v0.41.0 // indirect
127+
golang.org/x/text v0.35.0 // indirect
119128
golang.org/x/time v0.12.0 // indirect
120-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
121-
google.golang.org/grpc v1.72.2 // indirect
122-
google.golang.org/protobuf v1.36.8 // indirect
129+
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
130+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
131+
google.golang.org/grpc v1.80.0 // indirect
132+
google.golang.org/protobuf v1.36.11 // indirect
123133
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
124134
gopkg.in/inf.v0 v0.9.1 // indirect
125135
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)