-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07e0a0a
commit 1db9075
Showing
16 changed files
with
319 additions
and
19 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
controllers/monitor/builder/cue/engine/engine_template.cue
This file contains 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,34 @@ | ||
logs: { | ||
include:[string] | ||
} | ||
|
||
parameters: { | ||
clusterName: string | ||
componentName: string | ||
containerName: string | ||
metrics: { | ||
enabled: *true | bool | ||
collectionInterval: *"30s" | string | ||
enabled_metrics?: [string] | ||
} | ||
logs: { | ||
enabled: *true | bool | ||
logs_collector?: [logs] | ||
} | ||
} | ||
|
||
output: { | ||
"\(parameters.clusterName)/\(parameters.componentName)/\(parameters.containerName)/\(parameters.containerName)": { | ||
enabled_metrics: parameters.metrics.enabled | ||
enabled_logs: parameters.logs.enabled | ||
metrics_collector: { | ||
collection_interval: parameters.collection_interval | ||
if parameters.enabled_metrics != _|_ { | ||
enable_metrics: parameters.enabled_metrics | ||
} | ||
} | ||
if logs.logs_collector != _|_ { | ||
logs_collector: logs.logs_collector | ||
} | ||
} | ||
} |
This file contains 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,11 @@ | ||
parameters: { | ||
collection_interval: *"15s" | string, | ||
initial_delay: *"10s" | string, | ||
timeout: *"5s" | string, | ||
} | ||
|
||
output: { | ||
collection_interval: parameters.collection_interval, | ||
initial_delay: parameters.initial_delay, | ||
timeout: parameters.timeout, | ||
} |
This file contains 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 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 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
36 changes: 36 additions & 0 deletions
36
controllers/monitor/builder/cue/receiver/metrics/app/mongodb.cue
This file contains 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,36 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
output: | ||
apecloudmongo: { | ||
rule: "type == \"container\" && monitor_type == \"mongodb\" && config != nil && config.EnabledMetrics" | ||
config: { | ||
endpoint: "`endpoint`:27017" | ||
username: "`envs[\"MONGODB_ROOT_USER\"]`" | ||
password: "`envs[\"MONGODB_ROOT_PASSWORD\"]`" | ||
connect_params: "admin?ssl=false&authSource=admin" | ||
collect_all: true | ||
collection_interval: "`settings.CollectionInterval`" | ||
direct_connect: true | ||
global_conn_pool: false | ||
compatible_mode: true | ||
} | ||
resource_attributes: { | ||
job: oteld-app-metrics | ||
receiver: apecloudmongodb | ||
} | ||
} |
This file contains 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
47 changes: 47 additions & 0 deletions
47
controllers/monitor/builder/cue/receiver/metrics/app/postgresql.cue
This file contains 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,47 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
parameters: { | ||
enpoint: *"`endpoint`:5432" | string | ||
username: *"`envs[\"PGUSER_SUPERUSER\"]`" | string | ||
password: *"`envs[\"PGPASSWORD_SUPERUSER\"]`" | string | ||
job: *"oteld-app-metrics" | string | ||
databases: *["postgres"] | [string] | ||
exclude_databases: *["template0", "template1"] | [string] | ||
} | ||
|
||
output: | ||
apecloudpostgresql: { | ||
rule: "type == \"container\" && monitor_type == \"postgresql\" && config != nil && config.EnabledMetrics" | ||
config: { | ||
endpoint: parameters.enpoint | ||
username: parameters.username | ||
password: parameters.password | ||
databases: parameters.databases | ||
exclude_databases: parameters.exclude_databases | ||
collection_interval: "`settings.CollectionInterval`" | ||
transport: "tcp" | ||
tls: { | ||
insecure: true | ||
insecure_skip_verify: true | ||
} | ||
} | ||
resource_attributes: { | ||
job: parameters.job | ||
receiver: "apecloudpostgresql" | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
controllers/monitor/builder/cue/receiver/metrics/app/pulsar.cue
This file contains 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,41 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
parameters: { | ||
endpoint: *"`endpoint`:8000" | string | ||
} | ||
|
||
output: { | ||
"prometheus_simple/pulsar": { | ||
rule: "type == \"container\" && config != nil && config.EnabledMetrics && config.ClusterDefName == \"pulsar\" && ( config.ComponentDefName == \"bookies-recovery\" || config.ComponentDefName == \"zookeeper\" || config.ComponentDefName == \"bookies\" )" | ||
config: { | ||
collection_interval: "settings.CollectionInterval" | ||
use_service_account: false | ||
endpoint: parameters.endpoint | ||
disable_keep_alives: false | ||
} | ||
} | ||
"prometheus_simple/pulsar2": { | ||
rule: "type == \"container\" && config != nil && config.EnabledMetrics && config.ClusterDefName == \"pulsar\" && ( config.ComponentDefName == \"bookies-recovery\" || config.ComponentDefName == \"zookeeper\" || config.ComponentDefName == \"bookies\" )" | ||
config: { | ||
collection_interval: "settings.CollectionInterval" | ||
use_service_account: false | ||
endpoint: parameters.endpoint | ||
disable_keep_alives: false | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
controllers/monitor/builder/cue/receiver/metrics/app/qdrant.cue
This file contains 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,27 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
output: | ||
"prometheus_simple/qdrant": { | ||
rule: "type == \"container\" && config != nil && config.EnabledMetrics && config.ClusterDefName == \"qdrant\" && config.ComponentDefName == \"qdrant\"" | ||
config: { | ||
collection_interval: "`settings.CollectionInterval`" | ||
endpoint: "`endpoint`:6333" | ||
disable_keep_alives: false | ||
use_service_account: false | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
controllers/monitor/builder/cue/receiver/metrics/app/redis.cue
This file contains 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,45 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
parameters: { | ||
job: *"oteld-app-metrics" | string | ||
endpoint: *"`endpoint`:6379" | string | ||
username: *"envs[\"REDIS_REPL_USER\"]" | string | ||
password: *"envs[\"REDIS_REPL_PASSWORD\"]" | string | ||
} | ||
|
||
output: | ||
apecloudredis: { | ||
rule: "type == \"container\" && monitor_type == \"redis\" && config != nil && config.EnabledMetrics" | ||
config: { | ||
endpoint: parameters.endpoint | ||
username: parameters.username | ||
password: parameters.password | ||
password_file: "" | ||
lua_script: "" | ||
tls: { | ||
insecure: true | ||
insecure_skip_verify: true | ||
} | ||
collection_interval: "`settings.CollectionInterval`" | ||
} | ||
|
||
resource_attributes: { | ||
job: parameters.job | ||
receiver: "apecloudredis" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
controllers/monitor/builder/cue/receiver/metrics/app/wescale.cue
This file contains 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,34 @@ | ||
// Copyright (C) 2022-2023 ApeCloud Co., Ltd | ||
// | ||
// This file is part of KubeBlocks project | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
parameters: { | ||
metrics_path: *"/metrics" | string, | ||
endpoint: *"`endpoint`:`envs[\"VTTABLET_PORT\"]`" | string, | ||
disable_keep_alives: *false | bool, | ||
} | ||
|
||
output: | ||
"prometheus_simple/vttablet": { | ||
rule: "type == \"container\" && config != nil && config.EnabledMetrics && config.ComponentDefName == \"mysql\" && config.ClusterDefName == \"apecloud-mysql\" && config.ContainerName == \"vttablet\"" | ||
config: { | ||
collection_interval: "`settings.CollectionInterval`" | ||
use_service_account: false | ||
metrics_path: parameters.metrics_path | ||
endpoint: parameters.endpoint | ||
disable_keep_alives: parameters.disable_keep_alives | ||
} | ||
} |
This file contains 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
Oops, something went wrong.