Skip to content

Commit a618416

Browse files
authored
Merge pull request #943 from mjholder/dependency-metrics-ff
Control dependency metrics via a config or env
2 parents 1b228db + 059c06d commit a618416

File tree

7 files changed

+21
-5
lines changed

7 files changed

+21
-5
lines changed

config/deployment-template/clowder_config.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ data:
2323
"watchStrimziResources": ${WATCH_STRIMZI_RESOURCES},
2424
"enableKedaResources": ${ENABLE_KEDA_RESOURCES},
2525
"perProviderMetrics": ${PER_PROVIDER_METRICS},
26-
"reconciliationMetrics": ${RECONCILIATION_METRICS}
26+
"reconciliationMetrics": ${RECONCILIATION_METRICS},
27+
"enableDependencyMetrics": ${ENABLE_TELEMETRY_METRICS}
2728
},
2829
"settings": {
2930
"managedKafkaEphemDeleteRegex": "${MANAGED_EPHEM_DELETE_REGEX}"

controllers/cloud.redhat.com/clowdapp_reconciliation.go

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ func ReportDependencies(ctx context.Context, pClient client.Client, app *crd.Clo
9494
appDependencies := app.Spec.Dependencies
9595
appDependencies = append(appDependencies, app.Spec.OptionalDependencies...)
9696

97+
// Don't record metrics if not enabled
98+
if !clowderconfig.LoadedConfig.Features.EnableDependencyMetrics {
99+
return nil
100+
}
101+
97102
applist, err := env.GetAppsInEnv(ctx, pClient)
98103
if err != nil {
99104
return err

controllers/cloud.redhat.com/clowderconfig/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type ClowderConfig struct {
4141
KedaResources bool `json:"enableKedaResources"`
4242
PerProviderMetrics bool `json:"perProviderMetrics"`
4343
ReconciliationMetrics bool `json:"reconciliationMetrics"`
44+
EnableDependencyMetrics bool `json:"enableDependencyMetrics"`
4445
DisableCloudWatchLogging bool `json:"disableCloudWatchLogging"`
4546
EnableExternalStrimzi bool `json:"enableExternalStrimzi"`
4647
DisableRandomRoutes bool `json:"disableRandomRoutes"`

deploy-mutate.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -8395,8 +8395,9 @@ objects:
83958395
features\": {\n \"createServiceMonitor\": ${CREATE_SERVICE_MONITORS},\n\
83968396
\ \"watchStrimziResources\": ${WATCH_STRIMZI_RESOURCES},\n \"\
83978397
enableKedaResources\": ${ENABLE_KEDA_RESOURCES},\n \"perProviderMetrics\"\
8398-
: ${PER_PROVIDER_METRICS},\n \"reconciliationMetrics\": ${RECONCILIATION_METRICS}\n\
8399-
\ },\n \"settings\": {\n \"managedKafkaEphemDeleteRegex\": \"${MANAGED_EPHEM_DELETE_REGEX}\"\
8398+
: ${PER_PROVIDER_METRICS},\n \"reconciliationMetrics\": ${RECONCILIATION_METRICS},\n\
8399+
\ \"enableDependencyMetrics\": ${ENABLE_TELEMETRY_METRICS}\n },\n\
8400+
\ \"settings\": {\n \"managedKafkaEphemDeleteRegex\": \"${MANAGED_EPHEM_DELETE_REGEX}\"\
84008401
\n }\n}\n"
84018402
kind: ConfigMap
84028403
metadata:
@@ -8424,6 +8425,8 @@ parameters:
84248425
value: 'false'
84258426
- name: RECONCILIATION_METRICS
84268427
value: 'false'
8428+
- name: ENABLE_TELEMETRY_METRICS
8429+
value: 'false'
84278430
- name: MANAGED_EPHEM_DELETE_REGEX
84288431
value: .*ephemeral.*
84298432
- name: ENABLE_KEDA_RESOURCES

deploy.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -8368,8 +8368,9 @@ objects:
83688368
features\": {\n \"createServiceMonitor\": ${CREATE_SERVICE_MONITORS},\n\
83698369
\ \"watchStrimziResources\": ${WATCH_STRIMZI_RESOURCES},\n \"\
83708370
enableKedaResources\": ${ENABLE_KEDA_RESOURCES},\n \"perProviderMetrics\"\
8371-
: ${PER_PROVIDER_METRICS},\n \"reconciliationMetrics\": ${RECONCILIATION_METRICS}\n\
8372-
\ },\n \"settings\": {\n \"managedKafkaEphemDeleteRegex\": \"${MANAGED_EPHEM_DELETE_REGEX}\"\
8371+
: ${PER_PROVIDER_METRICS},\n \"reconciliationMetrics\": ${RECONCILIATION_METRICS},\n\
8372+
\ \"enableDependencyMetrics\": ${ENABLE_TELEMETRY_METRICS}\n },\n\
8373+
\ \"settings\": {\n \"managedKafkaEphemDeleteRegex\": \"${MANAGED_EPHEM_DELETE_REGEX}\"\
83738374
\n }\n}\n"
83748375
kind: ConfigMap
83758376
metadata:
@@ -8397,6 +8398,8 @@ parameters:
83978398
value: 'false'
83988399
- name: RECONCILIATION_METRICS
83998400
value: 'false'
8401+
- name: ENABLE_TELEMETRY_METRICS
8402+
value: 'false'
84008403
- name: MANAGED_EPHEM_DELETE_REGEX
84018404
value: .*ephemeral.*
84028405
- name: ENABLE_KEDA_RESOURCES

docsmd/developer-guide.md

+1
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ behaviour. They are detailed as follows:
463463
| ``features.enablekedaResources`` | Turns on the addition of Keda resources into the protectedGVK list. | No
464464
| ``features.perProviderMetrics`` | Turns on metrics that calculate reconciliation time per provider. | Yes
465465
| ``features.reconciliationMetrics`` | Enables extra detailed metrics on reconciliations per application. | Yes
466+
| ``features.enableDependencyMetrics`` | Turns on metrics that report availability of a ClowdApps dependencies. | Yes
466467
| ``disableCloudWatchLogging`` | Disables logging to CloudWatch. | Yes
467468
| ``enableExternalStrimzi`` | Enables talking to Strimzi via a local nodeport (only useful on minikube) | Yes
468469
| ``disableRandomRoutes`` | Gives the ability to disable the extra portion of randomness added to routes. | Yes

template.yml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ parameters:
2525
value: "false"
2626
- name: RECONCILIATION_METRICS
2727
value: "false"
28+
- name: ENABLE_TELEMETRY_METRICS
29+
value: "false"
2830
- name: MANAGED_EPHEM_DELETE_REGEX
2931
value: ".*ephemeral.*"
3032
- name: ENABLE_KEDA_RESOURCES

0 commit comments

Comments
 (0)