Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ServiceMonitor to monitor target allocator #2416

Merged
merged 36 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
66021f4
add create service monitor to targetallocator
changexd Dec 4, 2023
e56875c
add chlog
changexd Dec 4, 2023
560b15f
add e2e test to ta service monitor
changexd Dec 5, 2023
4cc1f21
fix linting
changexd Dec 5, 2023
c8c855d
make bundle
changexd Dec 5, 2023
8764da3
Merge branch 'main' into ta-service-monitor
changexd Dec 5, 2023
1f188b0
fix chlog
changexd Dec 5, 2023
bfb3af9
Merge branch 'main' into ta-service-monitor
changexd Dec 6, 2023
ef94a2f
add a condition to avoid creating sm when running in unsupported modes
changexd Dec 6, 2023
f1dc33f
update bundle
changexd Dec 6, 2023
eabb815
move ta sm ports into ta definition
changexd Dec 6, 2023
39059cd
Merge branch 'main' into ta-service-monitor
changexd Dec 7, 2023
de8bc76
remove changes to config/manager
changexd Dec 8, 2023
ebf8ee7
assert ta service monitor creation in e2e
changexd Dec 9, 2023
41d601c
Merge branch 'main' into ta-service-monitor
changexd Dec 9, 2023
1246aac
enable prometheus feature in e2e test
changexd Dec 11, 2023
9bbe614
Merge branch 'main' into ta-service-monitor
changexd Dec 12, 2023
f235362
change description of observability field
changexd Dec 12, 2023
f49464b
move ta observability check to build
changexd Dec 12, 2023
934b263
add target allocator to builder test
changexd Dec 13, 2023
93823b5
fix lint
changexd Dec 13, 2023
fde4422
fix ta sm manifest test
changexd Dec 13, 2023
3d2ba7d
remove changes to manager kustomization
changexd Dec 13, 2023
8da8af8
Merge branch 'main' into ta-service-monitor
changexd Dec 15, 2023
3863552
make ta sm return directly
changexd Dec 16, 2023
dc63340
move ta service monitor test to dedicated tests
changexd Dec 16, 2023
2f6726d
remove commands in e2e
changexd Dec 16, 2023
9b520ed
use function to generate label for sm
changexd Dec 18, 2023
e284412
Merge branch 'main' into ta-service-monitor
changexd Dec 18, 2023
b1ddba3
ta sm labels in builder test
changexd Dec 18, 2023
85a4275
merge with main
changexd Dec 19, 2023
508ad76
fix api.md
changexd Dec 19, 2023
2d709c3
fix bundling
changexd Dec 19, 2023
5b67f36
make api-docs again
changexd Dec 19, 2023
8cd6230
fix kustomization manager
changexd Dec 19, 2023
fd9fde7
fix ta service account in test according to fixed issues
changexd Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/2311-ta-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Create ServiceMonitor to monitor target allocator

# One or more tracking issues related to the change
issues: [2311]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
8 changes: 7 additions & 1 deletion apis/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ type OpenTelemetryTargetAllocator struct {
// consumed in the config file for the TargetAllocator.
// +optional
Env []v1.EnvVar `json:"env,omitempty"`
// ObservabilitySpec defines how telemetry data gets handled.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Observability"
Observability ObservabilitySpec `json:"observability,omitempty"`
}

type OpenTelemetryTargetAllocatorPrometheusCR struct {
Expand Down Expand Up @@ -487,7 +493,7 @@ type PodDisruptionBudgetSpec struct {

// MetricsConfigSpec defines a metrics config.
type MetricsConfigSpec struct {
// EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar mode) should be created for the OpenTelemetry Collector and Prometheus Exporters.
// EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar mode) should be created for the service managed by the OpenTelemetry Operator.
// The operator.observability.prometheus feature gate must be enabled to use this feature.
//
// +optional
Expand Down
1 change: 1 addition & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2023-12-06T14:31:16Z"
createdAt: "2023-12-12T02:32:20Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down Expand Up @@ -136,11 +136,23 @@ spec:
displayName: Metrics Config
path: observability.metrics
- description: EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar
mode) should be created for the OpenTelemetry Collector and Prometheus Exporters.
mode) should be created for the service managed by the OpenTelemetry Operator.
The operator.observability.prometheus feature gate must be enabled to use
this feature.
displayName: Create ServiceMonitors for OpenTelemetry Collector
path: observability.metrics.enableMetrics
- description: ObservabilitySpec defines how telemetry data gets handled.
displayName: Observability
path: targetAllocator.observability
- description: Metrics defines the metrics configuration for operands.
displayName: Metrics Config
path: targetAllocator.observability.metrics
- description: EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar
mode) should be created for the service managed by the OpenTelemetry Operator.
The operator.observability.prometheus feature gate must be enabled to use
this feature.
displayName: Create ServiceMonitors for OpenTelemetry Collector
path: targetAllocator.observability.metrics.enableMetrics
version: v1alpha1
description: |-
OpenTelemetry is a collection of tools, APIs, and SDKs. You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior.
Expand Down
20 changes: 18 additions & 2 deletions bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3708,8 +3708,8 @@ spec:
properties:
enableMetrics:
description: EnableMetrics specifies if ServiceMonitor or
PodMonitor(for sidecar mode) should be created for the OpenTelemetry
Collector and Prometheus Exporters. The operator.observability.
PodMonitor(for sidecar mode) should be created for the service
managed by the OpenTelemetry Operator. The operator.observability.
type: boolean
type: object
type: object
Expand Down Expand Up @@ -4966,6 +4966,22 @@ spec:
description: NodeSelector to schedule OpenTelemetry TargetAllocator
pods.
type: object
observability:
description: ObservabilitySpec defines how telemetry data gets
handled.
properties:
metrics:
description: Metrics defines the metrics configuration for
operands.
properties:
enableMetrics:
description: EnableMetrics specifies if ServiceMonitor
or PodMonitor(for sidecar mode) should be created for
the service managed by the OpenTelemetry Operator. The
operator.observability.
type: boolean
type: object
type: object
prometheusCR:
description: PrometheusCR defines the configuration for the retrieval
of PrometheusOperator CRDs ( servicemonitor.monitoring.coreos.com/v1
Expand Down
20 changes: 18 additions & 2 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3705,8 +3705,8 @@ spec:
properties:
enableMetrics:
description: EnableMetrics specifies if ServiceMonitor or
PodMonitor(for sidecar mode) should be created for the OpenTelemetry
Collector and Prometheus Exporters. The operator.observability.
PodMonitor(for sidecar mode) should be created for the service
managed by the OpenTelemetry Operator. The operator.observability.
type: boolean
type: object
type: object
Expand Down Expand Up @@ -4963,6 +4963,22 @@ spec:
description: NodeSelector to schedule OpenTelemetry TargetAllocator
pods.
type: object
observability:
description: ObservabilitySpec defines how telemetry data gets
handled.
properties:
metrics:
description: Metrics defines the metrics configuration for
operands.
properties:
enableMetrics:
description: EnableMetrics specifies if ServiceMonitor
or PodMonitor(for sidecar mode) should be created for
the service managed by the OpenTelemetry Operator. The
operator.observability.
type: boolean
type: object
type: object
prometheusCR:
description: PrometheusCR defines the configuration for the retrieval
of PrometheusOperator CRDs ( servicemonitor.monitoring.coreos.com/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,23 @@ spec:
displayName: Metrics Config
path: observability.metrics
- description: EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar
mode) should be created for the OpenTelemetry Collector and Prometheus Exporters.
mode) should be created for the service managed by the OpenTelemetry Operator.
The operator.observability.prometheus feature gate must be enabled to use
this feature.
displayName: Create ServiceMonitors for OpenTelemetry Collector
path: observability.metrics.enableMetrics
- description: ObservabilitySpec defines how telemetry data gets handled.
displayName: Observability
path: targetAllocator.observability
- description: Metrics defines the metrics configuration for operands.
displayName: Metrics Config
path: targetAllocator.observability.metrics
- description: EnableMetrics specifies if ServiceMonitor or PodMonitor(for sidecar
mode) should be created for the service managed by the OpenTelemetry Operator.
The operator.observability.prometheus feature gate must be enabled to use
this feature.
displayName: Create ServiceMonitors for OpenTelemetry Collector
path: targetAllocator.observability.metrics.enableMetrics
version: v1alpha1
description: |-
OpenTelemetry is a collection of tools, APIs, and SDKs. You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior.
Expand Down
Loading
Loading