Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm-mysql-exporter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
system
gm-mysql-exporter
Commits
7d9513f7
Commit
7d9513f7
authored
Dec 18, 2018
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update config
parent
1dfd3835
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
86 deletions
+3
-86
config.yaml
config.yaml
+2
-0
config_local.yaml
config_local.yaml
+0
-84
main.py
main.py
+1
-2
No files found.
config.yaml
View file @
7d9513f7
...
...
@@ -19,9 +19,11 @@ rds_instances:
rm-m5e63m5z6o4re1p49
:
name
:
mars.prod
connection_usage_factor
:
0.1
rm-m5e842126ng59jrv6
:
name
:
data.prod
connection_usage_factor
:
0.1
rm-m5eu1wmu0zt6j5n72
:
name
:
sms.prod
...
...
config_local.yaml
deleted
100644 → 0
View file @
1dfd3835
# 要监控的数据库实例
rds_instances
:
rdsfewzdmf0jfjp9un8xj
:
name
:
prod.zhengxing
# 连接数利用率因子,连接数利用率*该因子得到一个较为统一的标准,默认1
connection_usage_factor
:
1
# iops利用率因子, 默认 1
iops_usage_factor
:
1
# cpu利用率因子
cpu_usage_factor
:
1
# 内存利用率因子
memory_usage_factor
:
1
# 数据库类型,主库or从库, 默认master
type
:
master
rdsg2mpi623x6wioo796k
:
name
:
prod.readonly2.zhengxing
type
:
slave
rm-m5e63m5z6o4re1p49
:
name
:
mars.prod
rm-m5e842126ng59jrv6
:
name
:
data.prod
rm-m5eu1wmu0zt6j5n72
:
name
:
sms.prod
rr-m5e2vy0ke9q35kst5
:
name
:
prod.readonly.zhengxing
type
:
slave
rm-m5e90y907sw3bnz88
:
name
:
common.prod
rr-m5e2n024w0z293r5f
:
name
:
common.readonly
type
:
slave
rr-m5efx2m67mi002jq9
:
name
:
prod.readonly3.zhengxing
type
:
slave
rm-m5emg41za2w7l6au3
:
name
:
mimas_prod
rm-m5ey2s823bq0lc616
:
name
:
bran_prod
rr-m5et21lafq1677pid
:
name
:
mimas_readonly
type
:
slave
rr-m5e3036a5l18ym4t6
:
name
:
mimas_readonly01
type
:
slave
# 要监控的数据库指标
metrics
:
# 阿里云SDK查询字段
CpuUsage
:
# prometheus metric name
name
:
rds_cpu_usage_ratio
# CPU利用率因子,CPU利用率*该因子得到一个较为统一的标准
factor
:
cpu_usage_factor
MemoryUsage
:
name
:
rds_memory_usage_ratio
factor
:
memory_usage_factor
ConnectionUsage
:
name
:
rds_connection_usage_ratio
factor
:
connection_usage_factor
IOPSUsage
:
name
:
rds_iops_usage_ratio
factor
:
iops_usage_factor
# aliyun key and secret
aliyun_settings
:
key
:
LTAIfYsppxRX2Q5m
secret
:
lz7o7pf24zFqQ1JDesHYDTJ99wS058
main.py
View file @
7d9513f7
...
...
@@ -34,7 +34,6 @@ class RDSCollector(object):
all_rds_id
=
rds_instances
.
keys
()
# get metrics from aliyun
print
(
'get from aliyun'
)
for
label
in
queryname_metricname
.
keys
():
metrics_from_aliyun
[
label
]
=
[]
...
...
@@ -71,7 +70,7 @@ class RDSCollector(object):
point
[
'Average'
]
/
100.0
,
point
[
'timestamp'
]
/
1000
)
max_metric_family
.
add_metric
([
rds_name
,
rds_type
],
point
[
'Maximum'
]
/
100.0
,
point
[
'timestamp'
]
/
1000
)
with_factor_metric_family
.
add_metric
([
rds_name
,
rds_type
],
with_factor_metric_family
.
add_metric
([
rds_name
+
'*'
+
rds_factor
,
rds_type
],
point
[
'Average'
]
*
rds_factor
/
100.0
,
point
[
'timestamp'
]
/
1000
)
metrics
.
extend
([
avg_metric_family
,
max_metric_family
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment