-
Notifications
You must be signed in to change notification settings - Fork 1
feat: /metrics #21
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
Merged
Merged
feat: /metrics #21
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8032187
wip: metrics
eoghanlawless ab50cdc
feat: /v2/metrics
eoghanlawless fe37e01
wip: add initial metrics
eoghanlawless 79ef054
feat: implement response counter
eoghanlawless 152e70a
merge: main
eoghanlawless e20ab67
test: fix unit tests
eoghanlawless 48299be
chore: generate api
eoghanlawless c380aaa
test: update to workflow
eoghanlawless 976c0a7
version: 2.1.0
eoghanlawless c98eb07
chore: update workflow
eoghanlawless ea33af8
merge: main
eoghanlawless fd738d9
revert: local testing change
eoghanlawless b66ded5
feat: implement metrics service
eoghanlawless 21a532d
feat: add cluster-manager monitor
eoghanlawless 29311d3
merge: main
eoghanlawless bd56bec
version: 2.1.1
eoghanlawless 23e5f2a
chore: remove test changes
eoghanlawless d96b803
version: api 2.1.0
eoghanlawless 5aabbf1
version: 2.1.0
eoghanlawless 38e324a
chore: disable metrics by default
eoghanlawless e47e433
chore: /v2/metrics -> /metrics
eoghanlawless c99c801
chore: remove verbose debug log
eoghanlawless a705c2e
chore: address comments
eoghanlawless 40e5ab5
Merge branch 'main' into metrics
jokuniew 25dad75
chore: address comments
eoghanlawless 5743c20
chore: remove unused var
eoghanlawless d4253e5
test: add metrics package unit tests
eoghanlawless bba55cf
fix: remove duplicate port
eoghanlawless 12dcd67
fix: servicemonitor ports
eoghanlawless cf1c26b
chore: specify rest port protocol
eoghanlawless 309d629
chore: specify target port and protocol
eoghanlawless File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.1.0-dev | ||
| 2.1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
deployment/charts/cluster-manager/templates/metrics-service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| {{ if .Values.metrics.enabled -}} | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: cluster-manager-metrics | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- toYaml .Values.metrics.serviceMonitor.labels | indent 4 }} | ||
| spec: | ||
| endpoints: | ||
| - path: /metrics | ||
| port: metrics | ||
| scheme: http | ||
|
||
| - path: /v2/metrics | ||
| port: metrics | ||
| scheme: http | ||
| namespaceSelector: | ||
| matchNames: | ||
| - {{ .Release.Namespace }} | ||
| selector: | ||
| matchExpressions: | ||
| - key: prometheus.io/service-monitor | ||
| operator: NotIn | ||
| values: | ||
| - "false" | ||
| - key: app | ||
| operator: In | ||
| values: | ||
| - {{ .Values.metrics.service.labels.clusterManager.app | quote }} | ||
|
||
| - {{ .Values.metrics.service.labels.templateController.app | quote }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: cluster-metrics | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- toYaml .Values.metrics.service.labels.clusterManager | nindent 4 }} | ||
| spec: | ||
| ports: | ||
| - name: metrics | ||
| protocol: TCP | ||
| port: {{ .Values.metrics.service.port }} | ||
| targetPort: {{ .Values.metrics.service.port }} | ||
| selector: | ||
| app: "{{.Chart.Name}}-cm" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: templates-metrics | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- toYaml .Values.metrics.service.labels.templateController | nindent 4 }} | ||
| spec: | ||
| ports: | ||
togashidm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: metrics | ||
| protocol: TCP | ||
| port: {{ .Values.metrics.service.port }} | ||
| targetPort: {{ .Values.metrics.service.port }} | ||
| selector: | ||
| app: "{{.Chart.Name}}-controller" | ||
| {{- end -}} | ||
20 changes: 0 additions & 20 deletions
20
deployment/charts/cluster-manager/templates/metrics_service.yaml
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,34 +4,35 @@ | |
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{template "cluster-manager.fullname" .}} | ||
| name: {{ include "cluster-manager.fullname" . }} | ||
| namespace: {{.Release.Namespace}} | ||
| labels: | ||
| app: "{{.Chart.Name}}-cm" | ||
| spec: | ||
| selector: | ||
| app: "{{.Chart.Name}}-cm" | ||
| type: {{.Values.clusterManager.service.type}} | ||
| type: {{ .Values.clusterManager.service.type }} | ||
| ports: | ||
| - name: "rest" | ||
| port: {{.Values.clusterManager.service.rest.port}} | ||
| - name: rest | ||
| port: {{ .Values.clusterManager.service.rest.port }} | ||
|
|
||
| {{- if .Values.openpolicyagent.enabled -}} | ||
| {{- if .Values.service.opa.enabled }} | ||
| --- | ||
| apiVersion: v1 | ||
Check noticeCode scanning / Trivy limit range usage Low
Artifact: deployment/charts/cluster-manager/templates/service.yaml
Type: helm Vulnerability KSV039 Severity: LOW Message: limit range policy with a default request and limit, min and max request, for each container should be configure Link: KSV039 Check noticeCode scanning / Trivy resource quota usage Low
Artifact: deployment/charts/cluster-manager/templates/service.yaml
Type: helm Vulnerability KSV040 Severity: LOW Message: resource quota policy with hard memory and cpu quota per namespace should be configure Link: KSV040 |
||
| kind: Service | ||
| metadata: | ||
| name: {{ include "cluster-manager.fullname" . }}-opa | ||
| namespace: {{.Release.Namespace}} | ||
| labels: | ||
| {{- include "cluster-manager.labels" . | nindent 4 }} | ||
| spec: | ||
| type: {{ .Values.service.opa.type }} | ||
| ports: | ||
| - port: {{ .Values.service.opa.port }} | ||
| targetPort: opa | ||
| targetPort: {{ .Values.service.opa.port }} | ||
| protocol: TCP | ||
| name: http-opa | ||
| name: opa | ||
| selector: | ||
| {{- include "cluster-manager.selectorLabels" . | nindent 4 }} | ||
| {{- end}} | ||
|
|
||
29 changes: 0 additions & 29 deletions
29
deployment/charts/cluster-manager/templates/service_monitor.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.