Skip to content

Commit

Permalink
feat: add option to toggle metric scraping of chaos-daemon (chaos-mes…
Browse files Browse the repository at this point in the history
…h#4488)

Signed-off-by: Chris Ng <[email protected]>
Signed-off-by: Yue Yang <[email protected]>
Co-authored-by: Yue Yang <[email protected]>
  • Loading branch information
chris-ng-scmp and g1eny0ung authored Sep 20, 2024
1 parent 41fb4a2 commit 24a3c53
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For more information and how-to, see [RFC: Keep A Changelog](https://github.com/
- Support for reading database connection string from secret [#4363](https://github.com/chaos-mesh/chaos-mesh/pull/4363)
- Allow if condition for creating chaos-controller-manager ServiceAccount and allow setting securityContext for chaos-daemon pods [#4390](https://github.com/chaos-mesh/chaos-mesh/pull/4390)
- Integrate helm-values-schema-json to generate schema for values.yaml [#4435](https://github.com/chaos-mesh/chaos-mesh/pull/4435)
- Add an option to toggle metric scraping of Chaos Daemon [#4488](https://github.com/chaos-mesh/chaos-mesh/pull/4488)

### Changed

Expand Down
1 change: 1 addition & 0 deletions helm/chaos-mesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The following tables list the configurable parameters of the Chaos Mesh chart an
| `chaosDaemon.tolerations` | Toleration labels for chaos-daemon pod assignment | `[]` |
| `chaosDaemon.affinity` | Map of chaos-daemon node/pod affinities | `{}` |
| `chaosDaemon.updateStrategy` | Specify DaemonSetUpdateStrategy for chaos-daemon | `{}` |
| `chaosDaemon.service.scrape.enabled` | Enable metric scraping from Promethues by annotations | `true` |
| `dashboard.create` | Enable chaos-dashboard | `true` |
| `dashboard.databaseSecretName` | Optional, the secret name that has `DATABASE_DATASOURCE` defined | `` |
| `dashboard.rootUrl` | Specify the base url for openid/oauth2 (like GCP Auth Integration) callback URL. | `http://localhost:2333` |
Expand Down
2 changes: 2 additions & 0 deletions helm/chaos-mesh/templates/chaos-daemon-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ metadata:
namespace: {{ .Release.Namespace | quote }}
name: {{ template "chaos-daemon.svc" . }}
annotations:
{{- if .Values.chaosDaemon.service.scrape.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.chaosDaemon.httpPort }}"
{{- end }}
labels:
{{- include "chaos-mesh.labels" . | nindent 4 }}
app.kubernetes.io/component: chaos-daemon
Expand Down
13 changes: 13 additions & 0 deletions helm/chaos-mesh/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@
"properties": {},
"type": "object"
},
"service": {
"properties": {
"scrape": {
"properties": {
"enabled": {
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
},
"serviceAccount": {
"type": "string"
},
Expand Down
6 changes: 6 additions & 0 deletions helm/chaos-mesh/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ chaosDaemon:
# rollingUpdate:
# maxUnavailable: 33%

# Service setting for chaos-daemon
service:
scrape:
# Enable metric scraping from Promethues by annotations
enabled: true

dashboard:
# Enable chaos-dashboard
create: true
Expand Down

0 comments on commit 24a3c53

Please sign in to comment.