qunarcorp / bistoury Goto Github PK
View Code? Open in Web Editor NEWBistoury是去哪儿网的java应用生产问题诊断工具,提供了一站式的问题诊断方案
License: GNU General Public License v3.0
Bistoury是去哪儿网的java应用生产问题诊断工具,提供了一站式的问题诊断方案
License: GNU General Public License v3.0
通过 quick_start.sh 启动
你好,目前bistoury中的qunar.tc.bistoury.serverside.configuration.DynamicConfig
方法:
void addListener(Listener listener);
其中的参数qunar.tc.bistoury.serverside.configuration.Listener
目前的定义如下:
public interface Listener {
void onLoad(DynamicConfig config);
}
现在这种配置导致业务方在使用自己公司的ConfigCenter的时候不好适配,如下面这种情况就不太好适配。
return new DynamicConfig() {
@Override
public void addListener(Listener listener) {
mapConfig.addListener(new Configuration.SkipFirstConfigListener<Map<String, String>>() {
@Override
protected void doLoad(String application, String name, Map<String, String> value) {
//listener.onLoad();
}
});
}
// other methods override
}
建议可修改Listener
为如下接口:
public interface Listener<T> {
void onLoad(T config);
}
同时修改qunar.tc.bistoury.serverside.configuration.DynamicConfig
修改为:
interface DynamicConfig<T> {
void addListener(Listener<T> listener);
//....
}
从quick start里发现jvm-memory-monitor如果UI页面刚打开,则只有刚打开开始的监控数据。历史记录如果不开前端页面则无法监控吗还是打开方式不对
如果一台服务器有多个应用需要监控,那么在添加服务器时会报:“IP地址与XXXX的IP地址冲突,主机添加失败”。
这种情况下该怎么处理?有什么解决方法吗?
Java 应用部署在 Docker 中,那么 bistoury 也是同样的部署方式吗?
[19:19:26 [cpu-jstack-task-thread-1] QTraceId[] ERROR q.t.b.a.task.cpujstack.TaskRunner] - cpu jstack tast run error
java.lang.NoClassDefFoundError: com/sun/tools/attach/VirtualMachine
at qunar.tc.bistoury.agent.task.cpujstack.JStackPidExecutor.execute(JStackPidExecutor.java:42) ~[bistoury-agent-task-2.0.6.jar:na]
at qunar.tc.bistoury.agent.task.cpujstack.TaskRunner.doRun(TaskRunner.java:112) ~[bistoury-agent-task-2.0.6.jar:na]
at qunar.tc.bistoury.agent.task.cpujstack.TaskRunner.run(TaskRunner.java:85) ~[bistoury-agent-task-2.0.6.jar:na]
at com.google.common.util.concurrent.MoreExecutors$ScheduledListeningDecorator$NeverSuccessfulListenableFutureTask.run(MoreExecutors.java:623) [guava-20.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_111]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_111]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_111]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.VirtualMachine
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_111]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_111]
... 11 common frames omitted
想在开发机上面试下在线debug功能,但添加断点时报错 register breakpoint fail, File was not found in the executable
Springboot jar工程是用jdk1.7版本启动的
bistoury 是用jdk1.8启动的.
tail -f bistoury/bistoury.log
java.lang.IllegalStateException: register breakpoint fail, File was not found in the executable
at qunar.tc.bistoury.instrument.client.debugger.DefaultDebugger.doRegisterBreakpoint(DefaultDebugger.java:152) ~[bistoury-instrument-client-2.0.5.jar:na]
at qunar.tc.bistoury.instrument.client.debugger.DefaultDebugger.registerBreakpoint(DefaultDebugger.java:96) ~[bistoury-instrument-client-2.0.5.jar:na]
at qunar.tc.bistoury.attach.arthas.debug.QDebugClient.registerBreakpoint(QDebugClient.java:63) ~[bistoury-attach-arthas-2.0.5.jar:na]
at qunar.tc.bistoury.attach.arthas.debug.QDebugAddCommand.process(QDebugAddCommand.java:74) ~[bistoury-attach-arthas-2.0.5.jar:na]
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82) [arthas-core-3.1.1.jar:3.1.1]
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18) [arthas-core-3.1.1.jar:3.1.1]
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111) [arthas-core-3.1.1.jar:3.1.1]
at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108) [arthas-core-3.1.1.jar:3.1.1]
at com.taobao.arthas.core.shell.system.impl.QProcessImpl$CommandProcessTask.run(QProcessImpl.java:370) [bistoury-attach-arthas-2.0.5.jar:3.1.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
请帮下是什么原因导致失败.
not find proxy for agent
1.相比较于官方提供的快速启动版本的便捷性,这个伪生产部署(beta环境哈)真的是痛苦(不知道是不是因为k8s的原因)。
2.之前构建镜像时候启动脚本一直报一些错误(基于openjdk:8-jdk源镜像),可能是语法兼容性,做了些微调(这里就不赘述了)
3.浏览器 调用websocket前会先到ui拿去proxy的ws链接,但是返回的是ip(集群内部ip),导致浏览器一直无法建立连(本地局域网和集群网络是两套网络环境),后续手动改了下ui的源码,算是简单的跳过去了;
4.应用中心配置的应用及相关服务列表,这个感觉很不友好,每次都要手动配置agent绑定机器的ip及相关端口(不知道官方是否有啥好的实践,可以做到自动从zk中获取注册的agent(agent连接proxy后,proxy会把相应信息存到zk),因为k8s每次应用重新部署ip都会变更,所以调整及其不变,期待官方有好的建议给到,谢谢
bistoury-agent-bin/bin/bistoury-agent-env.sh中的BISTOURY_PROXY_HOST也需要改端口吧
是不是通过修改字节码获取所有的本地变量?
现在的逻辑是web console去遍历proxy,然后连接,这就导致web console要直连proxy,一般生产是不让本地直连的。合理的方式应该是web console连ui,然后ui去选择应该连哪一台proxy
在线debug遇到变量比较多,或者变量内容比较大的时候,想找到自己关注的变量比较困难,通过浏览器自带的搜索功能,可能会搜索到代码中的变量名字,建议增加查找功能,直接定位到变量所在的位置
直接域名的访问
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.(LinuxVirtualMachine.java:106) ~[tools.jar:na]
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63) ~[tools.jar:na]
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208) ~[tools.jar:na]
at qunar.tc.bistoury.agent.task.cpujstack.JStackPidExecutor.execute(JStackPidExecutor.java:42) ~[bistoury-agent-task-2.0.6.jar:na]
at qunar.tc.bistoury.agent.task.cpujstack.TaskRunner.doRun(TaskRunner.java:112) [bistoury-agent-task-2.0.6.jar:na]
at qunar.tc.bistoury.agent.task.cpujstack.TaskRunner.run(TaskRunner.java:85) [bistoury-agent-task-2.0.6.jar:na]
at com.google.common.util.concurrent.MoreExecutors$ScheduledListeningDecorator$NeverSuccessfulListenableFutureTask.run(MoreExecutors.java:623) [guava-20.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_212]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_212]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_212]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
你好,我使用如下命令启动快速部署脚本
能给看下啥原因吗 ?
建议将qunar.tc.bistoury.ui.service.ReleaseInfoService
暴露为一个公共的SPI接口,
因我司的release info的路径以及文件内容格式和Qunar的不同,所以我们想扩展这个接口的实现,
涉及:
qunar.tc.bistoury.ui.service.impl.ReleaseInfoServiceImpl
qunar.tc.bistoury.proxy.communicate.ui.handler.commandprocessor.processor.ArthasCommandProcessor
非常感谢。
I could not find any docs or even a description in English, so I decided to ask here. Do you plan to have english docs in the near future to demystify the project for the rest of the world (like alibaba/arthas for example 😄) ?
bistoury-proxy
模块中的Bootstrap
类中对webapp
路径的获取不太友好,完全依赖用户从什么目录下执行bistoury-proxy.sh
。
String webappDirLocation = "../webapp/";
StandardContext ctx = (StandardContext) tomcat.addWebapp("/", new File(webappDirLocation).getAbsolutePath());
这种写法相当于强制用户必须在bistoury-proxy/bin/
目录下执行./bistoury-proxy.sh start
命令。
使得像./bin/bistoury-proxy.sh start
之类的命令都不能使用。因为会导致获取不到webapp
的正确路径。
感觉应该在shell脚本中获取当前的bistoury-proxy的HOME地址,然后基于BISTOURY-PROXY-HOME/webapp
来读取会更好一些。
支持设置fullGc次数、CPU负载等报警吗,如果没有,后续会提供不
在“在线debug”上找到对应类,点击调试时提示如下:
反编译失败,/weblogic/deploy_dir/test-server-0.0.1-SNAPSHOT_deploy/20191219122403/test-server-0.0.1-SNAPSHOT/WEB-INF/lib/test-service-0.0.1-SNAPSHOT.jar (没有那个文件或目录)
分析agent报文发现根路径少了一个/home,详细报文如下:
[14:06:16 [bistoury-agent-netty-thread-1] QTraceId[] INFO q.t.b.remoting.netty.TaskProcessor] - receive decompiler command, id [191224.140615.9.1.183.120.18588.3254], command [DecompilerCommand{className='com.gf.test.networktest.controller.impl.NetworkTestControllerImpl', classPath='file:/home/weblogic/deploy_dir/test-server-0.0.1-SNAPSHOT_deploy/20191219122403/test-server-0.0.1-SNAPSHOT/WEB-INF/lib/test-service-0.0.1-SNAPSHOT.jar!/com/gf/test/networktest/controller/impl/NetworkTestControllerImpl.class'}]
[14:06:16 [log-agent-exec-0] QTraceId[] ERROR q.t.b.c.decompiler.DecompilerTask] - decompiler error, command: DecompilerCommand{className='com.gf.test.networktest.controller.impl.NetworkTestControllerImpl', classPath='file:/home/weblogic/deploy_dir/test-server-0.0.1-SNAPSHOT_deploy/20191219122403/test-server-0.0.1-SNAPSHOT/WEB-INF/lib/test-service-0.0.1-SNAPSHOT.jar!/com/gf/test/networktest/controller/impl/NetworkTestControllerImpl.class'}
java.io.FileNotFoundException: /weblogic/deploy_dir/test-server-0.0.1-SNAPSHOT_deploy/20191219122403/test-server-0.0.1-SNAPSHOT/WEB-INF/lib/test-service-0.0.1-SNAPSHOT.jar (没有那个文件或目录)
请问这是什么情况导致的?
如果不能要怎么改造?
请问bistoury对性能影响有多大呢,生产环境一直启动会有影响吗。
感觉加了GUI之后更像监控工具了,而不是调试工具,如果当作监控工具来用,一直开启会不会对性能影响较大,毕竟加了一个agent。。
类: ApplicationUserDaoImpl
private static final String ADD_USER_FOR_APP = "insert ignore bistoury_user_app (app_code, user_code) values (?, ?)";
这个SQL少了一个 into 关键字。
比如 java 库中的 Integer 、String 类都看不到加载,程序的源码类也都看不到
Thread Dump 里的信息确认完整。堆对象统计信息确认完整。
请问是哪里出了问题,多谢
BTW , great job!
/tmp/bistoury/releaseInfo.properties
ui依赖zk发现存活的proxy,是否可以考虑扩展支持其它的注册中心?比如Eureka,Nacos等
点击查看,出现一个警告,一个错误:
没有配置private token,代码查看仅可通过反编译
Agent error: java.lang.IllegalStateException---can not init bistoury, start arthas error, pid [9048],Agent JAR loaded but agent failed to initialize
还有什么配置的地方吗?
应用部署在同一服务器。
好像是agent 启动 bistoury netty client 请求proxy for agent config 时proxy还未启动完成
jdk8u40之后已经支持通过jcmd动态开启、停止、导出JFR的功能,建议bistoury增加支持,这样就不用自己登录服务器去查pid、开启、停止、dump这么繁琐的操作了
在在线debug中,怎么使用gitlab获取源码,而不是使用maven获取源码。按照文档的说法,这是可行的,但是我把maven.nexus.url 这个配置注释后,看ui的日志文件依然使用MavenRepositoryServiceImpl获取
版本:bistoury-2.0.6-quick-start.tar.gz
环境:Ubuntu 16.04.2 LTS \n \l java version "1.8.0_101",启动报错
./quick_start.sh: 84: ./quick_start.sh: [[: not found
./quick_start.sh: 88: ./quick_start.sh: [[: not found
./quick_start.sh: 93: ./quick_start.sh: [[: not found
./quick_start.sh: 97: ./quick_start.sh: [[: not found
./quick_start.sh: 103: ./quick_start.sh: [[: not found
命令格式错误,Usage: [./quick_start.sh -p pid -j java_home start] or [./quick_start.sh stop]
加上java_home 同样错误
在浏览器中返问 bistoury ui 项目的时候,出现如下错误
Agent error: java.lang.RuntimeException---java.lang.RuntimeException:
Cannot perf data for process 1000 - java.lang.IllegalArgumentException: Process not found
我系统是ubuntu,我启动的命令是bash quick_start.sh -p1000 start
直接使用quick_start.sh start会报如下错误
➜ bistoury bash quick_start.sh start
没有指定-c参数,agent将通过org.springframework.web.servlet.DispatcherServlet获取应用jar包路径
您好,有没有详细的,流程化的部署文档(生产部署),有些参数不知道是配置还是不配置。。。。
我参考https://github.com/qunarcorp/bistoury/blob/master/docs/cn/quick_start.md,第一次启动的时候,使用./quick_start.sh -p 1234 start进行启动,然后./quick_start.sh stop停止,第二次启动我想指定另外一个进程id,于是命令改为./quick_start.sh -p 6789 start,但是"在线debug"和动态监控里面读取处理的class信息仍然是第一次的那些.
[ERROR] Failed to execute goal on project bistoury-common: Could not resolve dependencies for project qunar.tc.bistoury:bistoury-common:jar:2.0.6: Failed to collect dependencies at com.google.guava:guava:jar:20.0: Failed to read artifact descriptor for com.google.guava:guava:jar:20.0: Could not transfer artifact com.google.guava:guava:pom:20.0 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/com/google/guava/guava/20.0/guava-20.0.pom: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.52.215] failed: Connection refused (Connection refused) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :bistoury-common
================ building bistoury proxy finished ================
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.