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

feat: Add support for all workloads: Deployment, Daemonset, Jobs, Statefulsets #1530

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1a3cc98
add support for all the resources
rakesh-garimella Oct 15, 2024
0a19e33
some more changes to manifest and added busola config
rakesh-garimella Oct 15, 2024
e5fca51
fixes
rakesh-garimella Oct 15, 2024
980cee5
remove filter for k8sClusterReceiver
rakesh-garimella Oct 15, 2024
019c3f6
some rbac changes and removal of filter
rakesh-garimella Oct 16, 2024
39689c2
fixes
rakesh-garimella Oct 16, 2024
ef1d304
add skip enrichment
rakesh-garimella Oct 17, 2024
d540e61
fixes
rakesh-garimella Oct 17, 2024
9ebff64
Merge branch 'main' into add-support-for-all-workloads
rakesh-garimella Oct 17, 2024
6971b86
Merge branch 'main' into add-support-for-all-workloads
k15r Oct 18, 2024
6172312
wip
rakesh-garimella Oct 21, 2024
8e0f671
filtering based on resources enabled
rakesh-garimella Oct 21, 2024
92629a8
some fixes
rakesh-garimella Oct 21, 2024
b26cb0b
fix tests
rakesh-garimella Oct 21, 2024
fb6e96a
allow dropping of metrics from resources based on if resource is enab…
rakesh-garimella Oct 21, 2024
5834b6f
Merge branch 'main' into add-support-for-all-workloads
rakesh-garimella Oct 22, 2024
e823827
fixes
rakesh-garimella Oct 22, 2024
7f24890
few more fixes
rakesh-garimella Oct 22, 2024
52775cd
add docs
rakesh-garimella Oct 22, 2024
6eeeb1a
added tests and some refactoring
rakesh-garimella Oct 23, 2024
c1393e2
Merge branch 'main' into add-support-for-all-workloads
rakesh-garimella Oct 23, 2024
2e16230
the test is green
rakesh-garimella Oct 23, 2024
f9cb821
fix
rakesh-garimella Oct 23, 2024
43fea06
fixes
rakesh-garimella Oct 23, 2024
6c81007
lint fix
rakesh-garimella Oct 24, 2024
f13e0f9
fixes
rakesh-garimella Oct 24, 2024
df2dc8f
fixes
rakesh-garimella Oct 24, 2024
fe57a5b
fix busola and lint
rakesh-garimella Oct 24, 2024
415b197
Merge branch 'main' into add-support-for-all-workloads
rakesh-garimella Oct 24, 2024
96a929d
fix docs based on review comments
rakesh-garimella Oct 24, 2024
2979a82
Merge branch 'main' into add-support-for-all-workloads
hisarbalik Oct 25, 2024
08e4626
apply PR review comments
hisarbalik Oct 25, 2024
d5c74c9
apply PR review comments
hisarbalik Oct 25, 2024
f7c98d1
Merge branch 'main' into add-support-for-all-workloads
hisarbalik Oct 25, 2024
cd61659
apply PR review comments
hisarbalik Oct 25, 2024
01d92fd
Apply suggestions from code review
hisarbalik Oct 25, 2024
45b364d
Merge branch 'main' into add-support-for-all-workloads
hisarbalik Oct 25, 2024
649bc85
fix linter issues
hisarbalik Oct 25, 2024
a794a1b
fix unit tests
hisarbalik Oct 25, 2024
b17be58
fix typos
hisarbalik Oct 25, 2024
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
6 changes: 3 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ linters-settings:
gocyclo:
# Minimal code complexity to report.
# Default: 30
# The max complexity while enabling this linter is 15. Please check if this can be reduced. Increase the threshold only if it is absolutely necessary.
min-complexity: 15
# The max complexity while enabling this linter is 17. Please check if this can be reduced. Increase the threshold only if it is absolutely necessary.
min-complexity: 17

wsl:
allow-trailing-comment: true
Expand Down Expand Up @@ -228,7 +228,7 @@ issues:
- linters: [ errcheck ]
path: test/testkit/otel/traces/traces.go
- linters: [ dupl ]
path: test/testkit/assert/(deployment|daemon_set|metrics|traces).go
path: test/testkit/assert/(deployment|daemon_set|metrics|traces|stateful_set|jobs).go
- linters: [ dupl ]
path: main.go
- linters:
Expand Down
18 changes: 17 additions & 1 deletion apis/telemetry/v1alpha1/metricpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type MetricPipelineRuntimeInput struct {
Namespaces *NamespaceSelector `json:"namespaces,omitempty"`
// Describes the Kubernetes resources for which runtime metrics are scraped.
// +optional
// +kubebuilder:default={pod: {enabled: true}, container: {enabled: true}, node: {enabled: false}, volume: {enabled: false}}
// +kubebuilder:default={pod: {enabled: true}, container: {enabled: true}, node: {enabled: false}, volume: {enabled: false}, daemonset: {enabled: false}, deployment: {enabled: false}, statefulset: {enabled: false}, job: {enabled: false}}
Resources *MetricPipelineRuntimeInputResources `json:"resources,omitempty"`
}

Expand All @@ -124,6 +124,22 @@ type MetricPipelineRuntimeInputResources struct {
// +optional
// +kubebuilder:default={enabled: false}
Volume *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"volume,omitempty"`
// Configures DaemonSet runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
DaemonSet *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"daemonset,omitempty"`
// Configures Deployment runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
Deployment *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"deployment,omitempty"`
// Configures StatefulSet runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
StatefulSet *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"statefulset,omitempty"`
// Configures Job runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
Job *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"job,omitempty"`
}

// MetricPipelineRuntimeInputResourceEnabledByDefault defines if the scraping of runtime metrics is enabled for a specific resource. The scraping is enabled by default.
Expand Down
20 changes: 20 additions & 0 deletions apis/telemetry/v1alpha1/zz_generated.deepcopy.go

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

18 changes: 17 additions & 1 deletion apis/telemetry/v1beta1/metricpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type MetricPipelineRuntimeInput struct {
Namespaces *NamespaceSelector `json:"namespaces,omitempty"`
// Describes the Kubernetes resources for which runtime metrics are scraped.
// +optional
// +kubebuilder:default={pod: {enabled: true}, container: {enabled: true}, node: {enabled: false}, volume: {enabled: false}}
// +kubebuilder:default={pod: {enabled: true}, container: {enabled: true}, node: {enabled: false}, volume: {enabled: false}, daemonset: {enabled: false}, deployment: {enabled: false}, statefulset: {enabled: false}, job: {enabled: false}}
Resources *MetricPipelineRuntimeInputResources `json:"resources,omitempty"`
}

Expand All @@ -124,6 +124,22 @@ type MetricPipelineRuntimeInputResources struct {
// +optional
// +kubebuilder:default={enabled: false}
Volume *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"volume,omitempty"`
// Configures DaemonSet runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
DaemonSet *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"daemonset,omitempty"`
// Configures Deployment runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
Deployment *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"deployment,omitempty"`
// Configures StatefulSet runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
StatefulSet *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"statefulset,omitempty"`
// Configures Job runtime metrics scraping.
// +optional
// +kubebuilder:default={enabled: false}
Job *MetricPipelineRuntimeInputResourceDisabledByDefault `json:"job,omitempty"`
}

// MetricPipelineRuntimeInputResourceEnabledByDefault defines if the scraping of runtime metrics is enabled for a specific resource. The scraping is enabled by default.
Expand Down
20 changes: 20 additions & 0 deletions apis/telemetry/v1beta1/zz_generated.deepcopy.go

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

24 changes: 24 additions & 0 deletions config/busola/metricpipeline_busola_extension_cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ data:
- name: Volume
visibility: $exists(spec.input.runtime.resources.volume)
source: spec.input.runtime.resources.volume.enabled
- name: DaemonSet
visibility: $exists(spec.input.runtime.resources.daemonset)
source: spec.input.runtime.resources.daemonset.enabled
- name: Deployment
visibility: $exists(spec.input.runtime.resources.deployment)
source: spec.input.runtime.resources.deployment.enabled
- name: StatefulSet
visibility: $exists(spec.input.runtime.resources.statefulset)
source: spec.input.runtime.resources.statefulset.enabled
- name: Job
visibility: $exists(spec.input.runtime.resources.job)
source: spec.input.runtime.resources.job.enabled
- name: OTLP
widget: Panel
visibility: $exists(spec.input.otlp)
Expand Down Expand Up @@ -350,6 +362,18 @@ data:
- name: Enable Volume Metrics
path: volume.enabled
simple: true
- name: Enable DaemonSet Metrics
path: daemonset.enabled
simple: true
- name: Enable Deployment Metrics
path: deployment.enabled
simple: true
- name: Enable StatefulSet Metrics
path: statefulset.enabled
simple: true
- name: Enable Job Metrics
path: job.enabled
simple: true
- name: OTLP
path: otlp
widget: FormGroup
Expand Down
52 changes: 52 additions & 0 deletions config/crd/bases/telemetry.kyma-project.io_metricpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,18 @@ spec:
default:
container:
enabled: true
daemonset:
enabled: false
deployment:
enabled: false
job:
enabled: false
node:
enabled: false
pod:
enabled: true
statefulset:
enabled: false
volume:
enabled: false
description: Describes the Kubernetes resources for which
Expand All @@ -239,6 +247,39 @@ spec:
resource are scraped. The default is `true`.
type: boolean
type: object
daemonset:
default:
enabled: false
description: Configures DaemonSet runtime metrics scraping.
properties:
enabled:
default: false
description: If enabled, the runtime metrics for the
resource are scraped. The default is `false`.
type: boolean
type: object
deployment:
default:
enabled: false
description: Configures Deployment runtime metrics scraping.
properties:
enabled:
default: false
description: If enabled, the runtime metrics for the
resource are scraped. The default is `false`.
type: boolean
type: object
job:
default:
enabled: false
description: Configures Job runtime metrics scraping.
properties:
enabled:
default: false
description: If enabled, the runtime metrics for the
resource are scraped. The default is `false`.
type: boolean
type: object
node:
default:
enabled: false
Expand All @@ -261,6 +302,17 @@ spec:
resource are scraped. The default is `true`.
type: boolean
type: object
statefulset:
default:
enabled: false
description: Configures StatefulSet runtime metrics scraping.
properties:
enabled:
default: false
description: If enabled, the runtime metrics for the
resource are scraped. The default is `false`.
type: boolean
type: object
volume:
default:
enabled: false
Expand Down
Loading
Loading