Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
76697183
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76697183
编写于
1月 03, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add alarm config into application.yml.
上级
f625cdd1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
119 addition
and
34 deletion
+119
-34
apm-collector/apm-collector-boot/src/main/resources/application.yml
...tor/apm-collector-boot/src/main/resources/application.yml
+10
-1
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java
.../collector/configuration/ConfigurationModuleProvider.java
+23
-7
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApdexThresholdService.java
...ollector/configuration/service/ApdexThresholdService.java
+7
-2
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java
...tor/configuration/service/ApplicationAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java
...guration/service/ApplicationReferenceAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceAlarmRuleConfig.java
...lector/configuration/service/InstanceAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceReferenceAlarmRuleConfig.java
...nfiguration/service/InstanceReferenceAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceAlarmRuleConfig.java
...llector/configuration/service/ServiceAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceReferenceAlarmRuleConfig.java
...onfiguration/service/ServiceReferenceAlarmRuleConfig.java
+12
-4
apm-collector/apm-collector-core/src/main/resources/application-default.yml
...collector-core/src/main/resources/application-default.yml
+7
-0
未找到文件。
apm-collector/apm-collector-boot/src/main/resources/application.yml
浏览文件 @
76697183
...
@@ -41,4 +41,13 @@ storage:
...
@@ -41,4 +41,13 @@ storage:
cluster_nodes
:
localhost:9300
cluster_nodes
:
localhost:9300
index_shards_number
:
2
index_shards_number
:
2
index_replicas_number
:
0
index_replicas_number
:
0
ttl
:
7
ttl
:
7
\ No newline at end of file
configuration
:
default
:
application_apdex_threshold
:
2000
service_error_rate_threshold
:
10.00
service_average_response_time_threshold
:
2000
instance_error_rate_threshold
:
10.00
instance_average_response_time_threshold
:
2000
application_error_rate_threshold
:
10.00
application_average_response_time_threshold
:
2000
\ No newline at end of file
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java
浏览文件 @
76697183
...
@@ -42,6 +42,14 @@ import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedExcepti
...
@@ -42,6 +42,14 @@ import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedExcepti
*/
*/
public
class
ConfigurationModuleProvider
extends
ModuleProvider
{
public
class
ConfigurationModuleProvider
extends
ModuleProvider
{
private
static
final
String
APPLICATION_APDEX_THRESHOLD
=
"application_apdex_threshold"
;
private
static
final
String
SERVICE_ERROR_RATE_THRESHOLD
=
"service_error_rate_threshold"
;
private
static
final
String
SERVICE_AVERAGE_RESPONSE_TIME_THRESHOLD
=
"service_average_response_time_threshold"
;
private
static
final
String
INSTANCE_ERROR_RATE_THRESHOLD
=
"instance_error_rate_threshold"
;
private
static
final
String
INSTANCE_AVERAGE_RESPONSE_TIME_THRESHOLD
=
"instance_average_response_time_threshold"
;
private
static
final
String
APPLICATION_ERROR_RATE_THRESHOLD
=
"application_error_rate_threshold"
;
private
static
final
String
APPLICATION_AVERAGE_RESPONSE_TIME_THRESHOLD
=
"application_average_response_time_threshold"
;
@Override
public
String
name
()
{
@Override
public
String
name
()
{
return
"default"
;
return
"default"
;
}
}
...
@@ -51,13 +59,21 @@ public class ConfigurationModuleProvider extends ModuleProvider {
...
@@ -51,13 +59,21 @@ public class ConfigurationModuleProvider extends ModuleProvider {
}
}
@Override
public
void
prepare
(
Properties
config
)
throws
ServiceNotProvidedException
{
@Override
public
void
prepare
(
Properties
config
)
throws
ServiceNotProvidedException
{
this
.
registerServiceImplementation
(
IApdexThresholdService
.
class
,
new
ApdexThresholdService
());
Integer
applicationApdexThreshold
=
(
Integer
)
config
.
getOrDefault
(
APPLICATION_APDEX_THRESHOLD
,
2000
);
this
.
registerServiceImplementation
(
IServiceAlarmRuleConfig
.
class
,
new
ServiceAlarmRuleConfig
());
Double
serviceErrorRateThreshold
=
(
Double
)
config
.
getOrDefault
(
SERVICE_ERROR_RATE_THRESHOLD
,
10.00
);
this
.
registerServiceImplementation
(
IInstanceAlarmRuleConfig
.
class
,
new
InstanceAlarmRuleConfig
());
Integer
serviceAverageResponseTimeThreshold
=
(
Integer
)
config
.
getOrDefault
(
SERVICE_AVERAGE_RESPONSE_TIME_THRESHOLD
,
2000
);
this
.
registerServiceImplementation
(
IApplicationAlarmRuleConfig
.
class
,
new
ApplicationAlarmRuleConfig
());
Double
instanceErrorRateThreshold
=
(
Double
)
config
.
getOrDefault
(
INSTANCE_ERROR_RATE_THRESHOLD
,
10.00
);
this
.
registerServiceImplementation
(
IServiceReferenceAlarmRuleConfig
.
class
,
new
ServiceReferenceAlarmRuleConfig
());
Integer
instanceAverageResponseTimeThreshold
=
(
Integer
)
config
.
getOrDefault
(
INSTANCE_AVERAGE_RESPONSE_TIME_THRESHOLD
,
2000
);
this
.
registerServiceImplementation
(
IInstanceReferenceAlarmRuleConfig
.
class
,
new
InstanceReferenceAlarmRuleConfig
());
Double
applicationErrorRateThreshold
=
(
Double
)
config
.
getOrDefault
(
APPLICATION_ERROR_RATE_THRESHOLD
,
10.00
);
this
.
registerServiceImplementation
(
IApplicationReferenceAlarmRuleConfig
.
class
,
new
ApplicationReferenceAlarmRuleConfig
());
Integer
applicationAverageResponseTimeThreshold
=
(
Integer
)
config
.
getOrDefault
(
APPLICATION_AVERAGE_RESPONSE_TIME_THRESHOLD
,
2000
);
this
.
registerServiceImplementation
(
IApdexThresholdService
.
class
,
new
ApdexThresholdService
(
applicationApdexThreshold
));
this
.
registerServiceImplementation
(
IServiceAlarmRuleConfig
.
class
,
new
ServiceAlarmRuleConfig
(
serviceErrorRateThreshold
,
serviceAverageResponseTimeThreshold
));
this
.
registerServiceImplementation
(
IInstanceAlarmRuleConfig
.
class
,
new
InstanceAlarmRuleConfig
(
instanceErrorRateThreshold
,
instanceAverageResponseTimeThreshold
));
this
.
registerServiceImplementation
(
IApplicationAlarmRuleConfig
.
class
,
new
ApplicationAlarmRuleConfig
(
applicationErrorRateThreshold
,
applicationAverageResponseTimeThreshold
));
this
.
registerServiceImplementation
(
IServiceReferenceAlarmRuleConfig
.
class
,
new
ServiceReferenceAlarmRuleConfig
(
serviceErrorRateThreshold
,
serviceAverageResponseTimeThreshold
));
this
.
registerServiceImplementation
(
IInstanceReferenceAlarmRuleConfig
.
class
,
new
InstanceReferenceAlarmRuleConfig
(
instanceErrorRateThreshold
,
instanceAverageResponseTimeThreshold
));
this
.
registerServiceImplementation
(
IApplicationReferenceAlarmRuleConfig
.
class
,
new
ApplicationReferenceAlarmRuleConfig
(
applicationErrorRateThreshold
,
applicationAverageResponseTimeThreshold
));
}
}
@Override
public
void
start
(
Properties
config
)
throws
ServiceNotProvidedException
{
@Override
public
void
start
(
Properties
config
)
throws
ServiceNotProvidedException
{
...
...
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApdexThresholdService.java
浏览文件 @
76697183
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
*
*
*/
*/
package
org.apache.skywalking.apm.collector.configuration.service
;
package
org.apache.skywalking.apm.collector.configuration.service
;
/**
/**
...
@@ -24,6 +23,12 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -24,6 +23,12 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
ApdexThresholdService
implements
IApdexThresholdService
{
public
class
ApdexThresholdService
implements
IApdexThresholdService
{
private
int
apdexThreshold
;
public
ApdexThresholdService
(
int
apdexThreshold
)
{
this
.
apdexThreshold
=
apdexThreshold
;
}
/**
/**
* Apdex T applies to web transactions only
* Apdex T applies to web transactions only
*
*
...
@@ -31,6 +36,6 @@ public class ApdexThresholdService implements IApdexThresholdService {
...
@@ -31,6 +36,6 @@ public class ApdexThresholdService implements IApdexThresholdService {
* @return This value is in milli-seconds.
* @return This value is in milli-seconds.
*/
*/
@Override
public
Integer
getApplicationApdexThreshold
(
int
applicationId
)
{
@Override
public
Integer
getApplicationApdexThreshold
(
int
applicationId
)
{
return
1000
;
return
apdexThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
ApplicationAlarmRuleConfig
implements
IApplicationAlarmRuleConfig
{
public
class
ApplicationAlarmRuleConfig
implements
IApplicationAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
ApplicationAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationReferenceAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
ApplicationReferenceAlarmRuleConfig
implements
IApplicationReferenceAlarmRuleConfig
{
public
class
ApplicationReferenceAlarmRuleConfig
implements
IApplicationReferenceAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
ApplicationReferenceAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
InstanceAlarmRuleConfig
implements
IInstanceAlarmRuleConfig
{
public
class
InstanceAlarmRuleConfig
implements
IInstanceAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
InstanceAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/InstanceReferenceAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
InstanceReferenceAlarmRuleConfig
implements
IInstanceReferenceAlarmRuleConfig
{
public
class
InstanceReferenceAlarmRuleConfig
implements
IInstanceReferenceAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
InstanceReferenceAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
ServiceAlarmRuleConfig
implements
IServiceAlarmRuleConfig
{
public
class
ServiceAlarmRuleConfig
implements
IServiceAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
ServiceAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ServiceReferenceAlarmRuleConfig.java
浏览文件 @
76697183
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
...
@@ -23,19 +23,27 @@ package org.apache.skywalking.apm.collector.configuration.service;
*/
*/
public
class
ServiceReferenceAlarmRuleConfig
implements
IServiceReferenceAlarmRuleConfig
{
public
class
ServiceReferenceAlarmRuleConfig
implements
IServiceReferenceAlarmRuleConfig
{
private
double
errorRateThreshold
;
private
int
averageResponseTimeThreshold
;
public
ServiceReferenceAlarmRuleConfig
(
double
errorRateThreshold
,
int
averageResponseTimeThreshold
)
{
this
.
errorRateThreshold
=
errorRateThreshold
;
this
.
averageResponseTimeThreshold
=
averageResponseTimeThreshold
;
}
@Override
public
double
calleeErrorRateThreshold
()
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
@Override
public
double
callerErrorRateThreshold
()
{
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
return
errorRateThreshold
;
}
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
2000
;
return
averageResponseTimeThreshold
;
}
}
}
}
apm-collector/apm-collector-core/src/main/resources/application-default.yml
浏览文件 @
76697183
...
@@ -33,6 +33,13 @@ analysis_alarm:
...
@@ -33,6 +33,13 @@ analysis_alarm:
default
:
default
:
configuration
:
configuration
:
default
:
default
:
application_apdex_threshold
:
2000
service_error_rate_threshold
:
10.00
service_average_response_time_threshold
:
2000
instance_error_rate_threshold
:
10.00
instance_average_response_time_threshold
:
2000
application_error_rate_threshold
:
10.00
application_average_response_time_threshold
:
2000
ui
:
ui
:
jetty
:
jetty
:
host
:
localhost
host
:
localhost
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录