Skip to content

Commit 8913d71

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/cache-5.0.3
2 parents 3a9a26d + d475a8b commit 8913d71

30 files changed

+3503
-64
lines changed

.chloggen/test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: new_component
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: clusterObservability
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Inital implementation of ClusterObservability CRD
9+
10+
# One or more tracking issues related to the change
11+
issues: [3820]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext: |
17+
This change provides an initial implementation of the Cluster Observability CRD and operator control loop.
18+
Reconcilation is disabled by default.
19+
Currently, the CRD is **not** included in the operator bundle and must be installed manually.
20+
To enable reconciliation, enable the `--feature-gates=+operator.clusterobservability` feature gate.

.github/workflows/continuous-integration.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ jobs:
8989
go-version: "~1.25.6"
9090

9191
- name: Initialize CodeQL
92-
uses: github/codeql-action/init@19b2f06db2b6f5108140aeb04014ef02b648f789 # v3.29.5
92+
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5
9393
with:
9494
languages: go
9595

9696
- name: Autobuild
97-
uses: github/codeql-action/autobuild@19b2f06db2b6f5108140aeb04014ef02b648f789 # v3.29.5
97+
uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5
9898

9999
- name: Perform CodeQL Analysis
100-
uses: github/codeql-action/analyze@19b2f06db2b6f5108140aeb04014ef02b648f789 # v3.29.5
100+
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5
101101

102102
- name: Govulncheck
103103
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4

.github/workflows/e2e-junit-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Download Test Report
24-
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
24+
uses: dawidd6/action-download-artifact@5c98f0b039f36ef966fdb7dfa9779262785ecb05 # v14
2525
with:
2626
path: '.testresults/e2e'
2727
name: 'e2e-junit-.*'
2828
name_is_regexp: 'true'
2929
run_id: ${{ github.event.workflow_run.id || inputs.e2e_workflow_id }}
3030
- name: Download Github Event File
31-
uses: dawidd6/action-download-artifact@0bd50d53a6d7fb5cb921e607957e9cc12b4ce392 # v12
31+
uses: dawidd6/action-download-artifact@5c98f0b039f36ef966fdb7dfa9779262785ecb05 # v14
3232
with:
3333
name: 'Event File'
3434
run_id: ${{ github.event.workflow_run.id || inputs.e2e_workflow_id }}

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@19b2f06db2b6f5108140aeb04014ef02b648f789 # v3.29.5
45+
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v3.29.5
4646
with:
4747
sarif_file: results.sarif

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,11 @@ api-docs: crdoc kustomize
840840
for crdmanifest in $$TMP_DIR/*; do \
841841
filename="$$(basename -s .opentelemetry.io.yaml $$crdmanifest)" ;\
842842
filename="$${filename#apiextensions.k8s.io_v1_customresourcedefinition_}" ;\
843-
$(CRDOC) --resources $$crdmanifest --output docs/api/$$filename.md ;\
843+
if [ "$$filename" = "clusterobservabilities" ]; then \
844+
echo "Skipping API documentation generation for clusterobservabilities (internal alpha API)" ;\
845+
else \
846+
$(CRDOC) --resources $$crdmanifest --output docs/api/$$filename.md ;\
847+
fi ;\
844848
done;\
845849
}
846850

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package v1alpha1
5+
6+
import (
7+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8+
)
9+
10+
// OTLPHTTPExporter defines OTLP HTTP exporter configuration.
11+
// This structure mirrors the official OpenTelemetry Collector otlphttpexporter configuration.
12+
type OTLPHTTPExporter struct {
13+
// Endpoint is the target base URL to send data to (e.g., https://example.com:4318).
14+
// +optional
15+
Endpoint string `json:"endpoint,omitempty"`
16+
17+
// TracesEndpoint is the target URL to send trace data to (e.g., https://example.com:4318/v1/traces).
18+
// If this setting is present the endpoint setting is ignored for traces.
19+
// +optional
20+
TracesEndpoint string `json:"traces_endpoint,omitempty"`
21+
22+
// MetricsEndpoint is the target URL to send metric data to (e.g., https://example.com:4318/v1/metrics).
23+
// If this setting is present the endpoint setting is ignored for metrics.
24+
// +optional
25+
MetricsEndpoint string `json:"metrics_endpoint,omitempty"`
26+
27+
// LogsEndpoint is the target URL to send log data to (e.g., https://example.com:4318/v1/logs).
28+
// If this setting is present the endpoint setting is ignored for logs.
29+
// +optional
30+
LogsEndpoint string `json:"logs_endpoint,omitempty"`
31+
32+
// ProfilesEndpoint is the target URL to send profile data to (e.g., https://example.com:4318/v1/development/profiles).
33+
// If this setting is present the endpoint setting is ignored for profiles.
34+
// +optional
35+
ProfilesEndpoint string `json:"profiles_endpoint,omitempty"`
36+
37+
// TLS defines TLS configuration for the exporter.
38+
// +optional
39+
TLS *TLSConfig `json:"tls,omitempty"`
40+
41+
// Timeout is the HTTP request time limit (e.g., "30s", "1m"). Default is 30s.
42+
// +optional
43+
Timeout string `json:"timeout,omitempty"`
44+
45+
// ReadBufferSize for HTTP client. Default is 0.
46+
// +optional
47+
// +kubebuilder:validation:Minimum=0
48+
ReadBufferSize *int `json:"read_buffer_size,omitempty"`
49+
50+
// WriteBufferSize for HTTP client. Default is 512 * 1024.
51+
// +optional
52+
// +kubebuilder:validation:Minimum=0
53+
WriteBufferSize *int `json:"write_buffer_size,omitempty"`
54+
55+
// SendingQueue defines configuration for the sending queue.
56+
// +optional
57+
SendingQueue *SendingQueueConfig `json:"sending_queue,omitempty"`
58+
59+
// RetryOnFailure defines retry configuration for failed requests.
60+
// +optional
61+
RetryOnFailure *RetryConfig `json:"retry_on_failure,omitempty"`
62+
63+
// Encoding defines the encoding to use for the messages.
64+
// Valid options: proto, json. Default is proto.
65+
// +optional
66+
// +kubebuilder:validation:Enum=proto;json
67+
Encoding string `json:"encoding,omitempty"`
68+
69+
// Compression defines the compression algorithm to use.
70+
// By default gzip compression is enabled. Use "none" to disable.
71+
// +optional
72+
// +kubebuilder:validation:Enum=gzip;none;""
73+
Compression string `json:"compression,omitempty"`
74+
75+
// Headers defines additional headers to be sent with each request.
76+
// +optional
77+
Headers map[string]string `json:"headers,omitempty"`
78+
}
79+
80+
// TLSConfig defines TLS configuration for the OTLP HTTP exporter.
81+
// This mirrors the OpenTelemetry Collector configtls settings.
82+
type TLSConfig struct {
83+
// CAFile is the path to the CA certificate file for server verification.
84+
// +optional
85+
CAFile string `json:"ca_file,omitempty"`
86+
87+
// CertFile is the path to the client certificate file for mutual TLS.
88+
// +optional
89+
CertFile string `json:"cert_file,omitempty"`
90+
91+
// KeyFile is the path to the client private key file for mutual TLS.
92+
// +optional
93+
KeyFile string `json:"key_file,omitempty"`
94+
95+
// Insecure controls whether to use insecure transport. Default is false.
96+
// +optional
97+
Insecure bool `json:"insecure,omitempty"`
98+
99+
// ServerName for TLS handshake. If empty, uses the hostname from endpoint.
100+
// +optional
101+
ServerName string `json:"server_name,omitempty"`
102+
}
103+
104+
// SendingQueueConfig defines configuration for the sending queue.
105+
type SendingQueueConfig struct {
106+
// Enabled controls whether the queue is enabled. Default is true.
107+
// +optional
108+
Enabled *bool `json:"enabled,omitempty"`
109+
110+
// NumConsumers is the number of consumers that dequeue batches. Default is 10.
111+
// +optional
112+
// +kubebuilder:validation:Minimum=1
113+
NumConsumers *int `json:"num_consumers,omitempty"`
114+
115+
// QueueSize is the maximum number of batches allowed in queue at a given time. Default is 1000.
116+
// +optional
117+
// +kubebuilder:validation:Minimum=1
118+
QueueSize *int `json:"queue_size,omitempty"`
119+
}
120+
121+
// RetryConfig defines retry configuration for failed requests.
122+
type RetryConfig struct {
123+
// Enabled controls whether retry is enabled. Default is true.
124+
// +optional
125+
Enabled *bool `json:"enabled,omitempty"`
126+
127+
// InitialInterval is the initial retry interval (e.g., "5s"). Default is 5s.
128+
// +optional
129+
InitialInterval string `json:"initial_interval,omitempty"`
130+
131+
// RandomizationFactor is the randomization factor for retry intervals (e.g., "0.5"). Default is 0.5.
132+
// +optional
133+
RandomizationFactor string `json:"randomization_factor,omitempty"`
134+
135+
// Multiplier is the multiplier for retry intervals (e.g., "1.5"). Default is 1.5.
136+
// +optional
137+
Multiplier string `json:"multiplier,omitempty"`
138+
139+
// MaxInterval is the maximum retry interval (e.g., "30s"). Default is 30s.
140+
// +optional
141+
MaxInterval string `json:"max_interval,omitempty"`
142+
143+
// MaxElapsedTime is the maximum elapsed time for retries (e.g., "5m"). Default is 5m.
144+
// +optional
145+
MaxElapsedTime string `json:"max_elapsed_time,omitempty"`
146+
}
147+
148+
// ClusterObservabilitySpec defines the desired state of ClusterObservability.
149+
// This follows a simplified design using a single OTLP HTTP exporter for all signals.
150+
type ClusterObservabilitySpec struct {
151+
// Exporter defines the OTLP HTTP exporter configuration for all signals.
152+
// The collector will automatically append appropriate paths for each signal type.
153+
// +required
154+
Exporter OTLPHTTPExporter `json:"exporter"`
155+
}
156+
157+
// ClusterObservabilityConditionType represents the type of condition.
158+
type ClusterObservabilityConditionType string
159+
160+
const (
161+
// ClusterObservabilityConditionReady indicates whether the ClusterObservability is ready.
162+
ClusterObservabilityConditionReady ClusterObservabilityConditionType = "Ready"
163+
// ClusterObservabilityConditionConfigured indicates whether the ClusterObservability is configured.
164+
ClusterObservabilityConditionConfigured ClusterObservabilityConditionType = "Configured"
165+
// ClusterObservabilityConditionConflicted indicates that multiple ClusterObservability resources exist.
166+
ClusterObservabilityConditionConflicted ClusterObservabilityConditionType = "Conflicted"
167+
)
168+
169+
const (
170+
// ClusterObservabilityFinalizer is the finalizer used for ClusterObservability resources.
171+
ClusterObservabilityFinalizer = "clusterobservability.opentelemetry.io/finalizer"
172+
)
173+
174+
// ClusterObservabilityCondition represents a condition of a ClusterObservability.
175+
type ClusterObservabilityCondition struct {
176+
// Type of condition.
177+
// +required
178+
Type ClusterObservabilityConditionType `json:"type"`
179+
180+
// Status of the condition.
181+
// +required
182+
Status metav1.ConditionStatus `json:"status"`
183+
184+
// Last time the condition transitioned from one status to another.
185+
// +optional
186+
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
187+
188+
// The reason for the condition's last transition.
189+
// +optional
190+
Reason string `json:"reason,omitempty"`
191+
192+
// A human readable message indicating details about the transition.
193+
// +optional
194+
Message string `json:"message,omitempty"`
195+
196+
// ObservedGeneration represents the .metadata.generation that the condition was set based upon.
197+
// +optional
198+
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
199+
}
200+
201+
// ClusterObservabilityStatus defines the observed state of ClusterObservability.
202+
type ClusterObservabilityStatus struct {
203+
// Conditions represent the latest available observations of the ClusterObservability state.
204+
// +optional
205+
// +listType=map
206+
// +listMapKey=type
207+
Conditions []ClusterObservabilityCondition `json:"conditions,omitempty"`
208+
209+
// ObservedGeneration is the most recent generation observed for this ClusterObservability.
210+
// It corresponds to the ClusterObservability's generation, which is updated on mutation
211+
// by the API Server.
212+
// +optional
213+
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
214+
215+
// Phase represents the current phase of the ClusterObservability.
216+
// +optional
217+
Phase string `json:"phase,omitempty"`
218+
219+
// Message provides additional information about the current state.
220+
// +optional
221+
Message string `json:"message,omitempty"`
222+
223+
// ComponentsStatus provides status information about individual observability components.
224+
// +optional
225+
ComponentsStatus map[string]ComponentStatus `json:"componentsStatus,omitempty"`
226+
227+
// ConfigVersions tracks the version hashes of the configuration files used.
228+
// This enables detection of config changes when operator is upgraded.
229+
// +optional
230+
ConfigVersions map[string]string `json:"configVersions,omitempty"`
231+
}
232+
233+
// ComponentStatus represents the status of an individual component.
234+
type ComponentStatus struct {
235+
// Ready indicates whether the component is ready.
236+
// +optional
237+
Ready bool `json:"ready,omitempty"`
238+
239+
// Message provides additional information about the component status.
240+
// +optional
241+
Message string `json:"message,omitempty"`
242+
243+
// LastUpdated is the last time this status was updated.
244+
// +optional
245+
LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
246+
}
247+
248+
// +kubebuilder:object:root=true
249+
// +kubebuilder:subresource:status
250+
// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.exporter.endpoint",description="OTLP exporter endpoint"
251+
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Current phase"
252+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
253+
// +operator-sdk:csv:customresourcedefinitions:displayName="Cluster Observability"
254+
// +operator-sdk:csv:customresourcedefinitions:resources={{Pod,v1},{Deployment,apps/v1},{ConfigMap,v1},{Service,v1},{DaemonSet,apps/v1}}
255+
256+
// ClusterObservability is the Schema for the clusterobservabilities API.
257+
type ClusterObservability struct {
258+
metav1.TypeMeta `json:",inline"`
259+
metav1.ObjectMeta `json:"metadata,omitempty"`
260+
261+
Spec ClusterObservabilitySpec `json:"spec,omitempty"`
262+
Status ClusterObservabilityStatus `json:"status,omitempty"`
263+
}
264+
265+
// +kubebuilder:object:root=true
266+
267+
// ClusterObservabilityList contains a list of ClusterObservability.
268+
type ClusterObservabilityList struct {
269+
metav1.TypeMeta `json:",inline"`
270+
metav1.ListMeta `json:"metadata,omitempty"`
271+
Items []ClusterObservability `json:"items"`
272+
}
273+
274+
func init() {
275+
SchemeBuilder.Register(&ClusterObservability{}, &ClusterObservabilityList{})
276+
}

0 commit comments

Comments
 (0)