what-kamon

The Redefine Team Lv5

什么是Kamon

一个jvm 监控工具, 通过简单的注解可以非常容易的将需要监控的信息,进行上报

比如通过将Kamon 信息上传到StatsD, 然后StatsD 周期性的将信息上传到grafana 面板

主要注解

@EnableKamon

@Segment

@Trace

配置文件

默认读取application.conf 文件

application.conf 内容类似如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

## To fix the issue that Spring Boot 2.1 disable the bean definition override by default
spring.main.allow-bean-definition-overriding=true

###############################
# Kamon related configuration #
###############################

kamon {

metric {
filters {
trace.includes = ["**"]
trace-segment.includes = ["**"]
trace-segment.excludes = []
akka-actor.includes = []
akka-actor.excludes = ["**"]
akka-dispatcher.includes = []
akka-dispatcher.excludes = ["**"]
}
}

show-aspectj-missing-warning = no

modules {
kamon-annotation {
auto-start = no
requires-aspectj = yes
}

kamon-log-reporter {
auto-start = no
requires-aspectj = no
}

kamon-statsd {
auto-start = no
requires-aspectj = no
}
}

statsd {
# Hostname and port in which your StatsD is running. Remember that StatsD packets are sent using UDP and
# setting unreachable hosts and/or not open ports wont be warned by the Kamon, your data wont go anywhere.
hostname = "localhost"
port = 8125

# Interval between metrics data flushes to StatsD. It's value must be equal or greater than the
# kamon.metrics.tick-interval setting.
flush-interval = 10 second

# Subscription patterns used to select which metrics will be pushed to StatsD. Note that first, metrics
# collection for your desired entities must be activated under the kamon.metrics.filters settings.
includes {
actor = []
trace = ["*"]
trace-segment = ["*"]
dispatcher = []
}

subscriptions {
histogram = ["**"]
min-max-counter = ["**"]
gauge = ["**"]
counter = ["**"]
trace = ["**"]
trace-segment = ["**"]
akka-actor = []
akka-dispatcher = []
akka-router = []
system-metric = ["**"]
http-server = []
}
}
}

后通过javaagent 加载aspectjweaver 将监控信息写入StatsD

待续

目前还没有成功

  1. 在fastjar 情况下,不能找到aspectj 的一个类,导致没有办法kamon start

– cmonkey 2019年3月28日16:58:12

  • 标题: what-kamon
  • 作者: The Redefine Team
  • 创建于 : 2019-03-27 16:57:32
  • 更新于 : 2023-05-23 18:52:03
  • 链接: https://redefine.ohevan.com/2019/03/27/what-kamon/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论