Comments (53)
可以了!漏了这个 libcurl-devel
感谢!
可以的话,提个小小意见,能不能在扩展编译的时候去检查这些依赖软件和版本。这样就完美了
from molten.
@acoldog 其实对于curl的支持是一个可选项, 只不过没有在编译的时候体现出来, 之前考虑是隐式检查,减少负担,现在看来反而造成了困扰, 之后我还是把这个选项编程显示化的把
from molten.
@long904 不需要docker环境的, 如果没有docker 我们的示例会下载一个zipkin server。
对版本是有要求的 5.4 以上的。
from molten.
嗯。PHP5.6上 运行 run.sh 时,报出「which:no docker in (/usr/local/sbin:……」这样,便终止了。请问这为什么呢?
from molten.
这个问题我猜是脚本中判断这一项存在问题,
zipkin=`ps aux|grep zipkin|grep -v grep`
可能是你编译了zipkin文件。。 我重新修改一下脚本, 你再试试
from molten.
谢谢。重新 clone 了,运行 run.sh 下载了zikpin.jar 包,并且启动了zipkin 服务。但是浏览器打开 http://x.x.x/:9411/zipkin/ 没有任何数据。即使是 end time 推迟了1小时(我在17:29运行的)
from molten.
运行验证例子的时候有任何的输出吗??
from molten.
from molten.
我的意思是运行一下这个:
php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=2 -d molten.tracing_cli=1 -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
有什么信息输出吗
from molten.
是的,我明白。我刚是没表达好,看刚的截图,没有任何信息输出。截图里还有 PHP 版本信息。现在运行你给出的,也是没有任何信息输出。
但是我之前在另外一台机器试过运行验证有信息输出,但还是没数据。
from molten.
要不你贴一下php编译选项,以及环境变量吧。
from molten.
php编译参数,大部分模块是后面自行添加(包括 molten)
'./configure' '--prefix=/usr/local/php-5.4' '--enable-libxml' '--enable-fpm' '--enable-cgi' '--with-mysql' '--with-mysqli' '--with-pdo-mysql'
然后,不太理解你说的环境变量是否指系统环境变量。我先给出这样的:
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/php/bin:/usr/local/jdk1.8.0_112/bin:/usr/local/jdk1.8.0_112/bin:/root/bin
from molten.
我怀疑是你设置了什么http_proxy之类的, 还是有zipkin server 正常启动了吗?
from molten.
http_proxy 没有设置的,或者怎么确认。服务器在阿里云,但也没有什么特别限制。zipkin server 在编译完成后通过 run.sh 启动了的。
ps aux|grep zipkin|grep -v grep
root 29179 0.1 3.3 8275520 553472 ? Sl Aug30 2:40 java -jar zipkin.jar --logging.level.zipkin=DEBUG
from molten.
在启动了zipkin server上 执行一下这个, 你看看有数据吗
curl -X POST \
http://192.168.56.10:9411/api/v1/spans \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '[{"traceId":"ab7fbc5f3344abdd","name":"php_curl","version":"php-4","id":"629e43a479b1d3de","parentId":"daf9ddffc77a7e99","timestamp":1504487189736333,"duration":5516,"annotations":[{"value":"cs","timestamp":1504487189736333,"endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}},{"value":"cr","timestamp":1504487189741849,"endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}}],"binaryAnnotations":[{"key":"http.url","value":"http:\/\/localhost:12345\/","endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}},{"key":"error","value":"Failed connect to localhost:12345; Connection refused","endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}}]},{"traceId":"ab7fbc5f3344abdd","name":"cli","version":"php-4","id":"daf9ddffc77a7e99","timestamp":1504487189736094,"duration":5876,"annotations":[{"value":"sr","timestamp":1504487189736094,"endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}},{"value":"ss","timestamp":1504487189741970,"endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}}],"binaryAnnotations":[{"key":"path","value":"-","endpoint":{"serviceName":"complex","ipv4":"10.0.2.10"}}]}]'
from molten.
把上面的地址改成了 http://127.0.0.1:9411/api/v1/spans ,命令行执行没有任何输出数据。
打开浏览器,以下内容
from molten.
这个监控信息已经进入到 zipkin server中了。
你看complex 那里, 你现在将endtime向后调一段,应该就可以看到了。
from molten.
是的。我刚忘记说,系统终端执行后没有任何信息输出,打开浏览器刚开始也是。我是把endtime 往后调了一小时,就出现如图的。但我再把 endtime 往后调两小时(比如07:28)。还是这样的显示,也没更多的信息出来。
from molten.
你还需要点击 find traces 才能查询出相应的trace信息。
from molten.
我点了啊~ 还是这样的。另外,其他的信息。比如像运行 run.sh 后的,又改如何看呢?
from molten.
start time 你设置7:00, endtime你设置为10:00, 你现在设置的那个时间段有问题呀。。
from molten.
是的。现在看到了,谢谢。
有些疑问:
1)像我运行以下的,也看不到,即使是时间段调整了。
php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=4 -d molten.tracing_cli=1 -d molten.sink_http_uri=http://127.0.0.1:9411/api/v1/spans -d molten.service_name=php_test -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
2)其他的信息我该怎么查看呢,比如,想分析自己网站的PHP 运行状态的话。
from molten.
第一个问题,你要确定,确实能够生成trace 日志。设置molten.sink_type=2, 看是否存在输出。
第二个问题, 你需要将molten 作为扩展安装到你的网站机器上, 通过设置molten.sink_type=, 多种输出方式,将分析信息收集到zipkin server 即可。
from molten.
谢谢。
第一个问题,改成2,有信息输出。但是浏览器打开没有,比如我刚运行了start time 调成07:00,end time 调成11:00(或者12:10)。也还是没有。
第二个问题,我已经安装扩展了。php.ini 修改extension=molten.so,看到可以成功加载。但还是没看到网站相关的任何东西,是否需要其他参数设置了。比如你刚说的「molten.sink_type=,」这个值是「,」吗?
from molten.
@long904
第一个问题, sink_type是指的输出日志类型, 1是文件, 2是标准输出, 4是http 输出, 你需要修改sink_type=4, 配置sink_http_uri配置项输出到具体的收集器, 文中的为zipkin server。 只能选择一种输出方式。
第二个问题同第一个问题, 详细请看readme中关于sink_type的介绍
from molten.
嗯。感谢回答。我意思,你看这个
php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=4 -d molten.tracing_cli=1 -d molten.sink_http_uri=http://127.0.0.1:9411/api/v1/spans -d molten.service_name=php_test -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
sink_type=4, sink_http_uri 也是 zipkin server 了。但是浏览器打开还是没有任何信息
from molten.
@long904 你看哈
第一,扩展能够抓取到信息, 第二个 zipkin能够接收到信息,这个中间环节出现了问题。。
from molten.
嗯。我在不少于三、四台不同的机器上试过了。PHP5.4、PHP5.6都试过。结果都是一样。我不知道问题在哪。唉~
from molten.
刚再验证,试了。转到文件形式,是能记录的。但是换成 http 就不行
from molten.
你这样试试, 启动一个nc server
nc -l 1111
然后设置 molten.sink_http_uri=http://127.0.0.1:1111, 看nc server中显示什么
from molten.
终端1:
nc -l 55555
终端2:
#php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=4 -d molten.tracing_cli=1 -d molten.sink_http_uri=http://127.0.0.1:55555 -d molten.service_name=php_test -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
nc 里没有任何输出。在 php.ini 修改molten.sink_http_uri=http://127.0.0.1:55555 ,也是同样结果,没有输出。
from molten.
telnet 55555端口是通的。防火墙等没有任何设置。
from molten.
我碰到跟楼主一样的问题,我的是php7.0.10
设置sink_type=1设置写入文件是有数据写入的,但是设置成
molten.sink_type=4
molten.sink_http_uri=http://127.0.0.1:9411/api/v1/spans
在zipkin后台就看不到任何数据
试过上边讨论的方式都不行,求解决
from molten.
@acoldog 有一个debug分支,你用这个编译一下, 然后贴一下输出, 我来判断一下把
from molten.
$ php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=2 -d molten.tracing_cli=1 -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);' [{"traceId":"df75f4c3b48e15a2","name":"php_curl","version":"php-4","id":"4daad9dbaace1b68","parentId":"1e6a1dce5b7ed2a0","timestamp":1506492572413668,"duration":836,"annotations":[{"value":"cs","timestamp":1506492572413668,"endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}},{"value":"cr","timestamp":1506492572414504,"endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}}],"binaryAnnotations":[{"key":"http.url","value":"http:\/\/localhost:12345\/","endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}},{"key":"error","value":"Failed to connect to localhost port 12345: Connection refused","endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}}]},{"traceId":"df75f4c3b48e15a2","name":"cli","version":"php-4","id":"1e6a1dce5b7ed2a0","timestamp":1506492572413459,"duration":1104,"annotations":[{"value":"sr","timestamp":1506492572413459,"endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}},{"value":"ss","timestamp":1506492572414563,"endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}}],"binaryAnnotations":[{"key":"path","value":"-","endpoint":{"serviceName":"default","ipv4":"10.168.227.85"}}]}]
重装了debug branch,输出是有,但是改成zipkin的方式收集日志就不行,zipkin后台老是没有数据
from molten.
@acoldog 编译的时候 添加这个编译参数make CFLAGS="-DMOLTEN_DEBUG", 之前没有把编译的参数写上去, 抱歉
from molten.
感谢你的耐心解答,我重新编译 make CFLAGS="-DMOLTEN_DEBUG" 这一步之后有报错:
这个会有影响吗?
from molten.
@acoldog 你可以重新拉取一下分支, 我新修改了一点东西
from molten.
还是一样,make CFLAGS="-DMOLTEN_DEBUG" 报一样的错误,忽略继续make install
运行后,zipkin还是没有收到数据
from molten.
会有debug信息打印出来, 贴一下
from molten.
不好意思,刚刚下错包
15:45:58 INFO /apps/svr/molten-debug/molten.c:555: molten start
15:45:58 INFO /apps/svr/molten-debug/molten_log.c:201: [sink] current select sink_type:0, input type4
15:45:58 INFO /apps/svr/molten-debug/molten.c:626: molten request init
15:45:58 INFO /apps/svr/molten-debug/molten.c:670: molten request shutdown
15:45:58 INFO /apps/svr/molten-debug/molten_log.c:478: [sink] mo log flush
15:45:58 INFO /apps/svr/molten-debug/molten_log.c:527: [sink] mo log flush detail size:1148
15:45:58 INFO /apps/svr/molten-debug/molten_log.c:429: [sink] mo log write sink_type [0]
15:45:58 ERROR /apps/svr/molten-debug/molten_log.c:469: [sink] input error type [0]
from molten.
php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=4 -d molten.tracing_cli=1 -d molten.sink_http_uri=http://127.0.0.1:9411/api/v1/spans -d molten.service_name=php_test -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
执行的时候就会打印信息
from molten.
16:02:35 INFO /apps/svr/molten-debug/molten.c:555: molten start
16:02:35 INFO /apps/svr/molten-debug/molten_log.c:201: [sink] current select sink_type:0, input type4
16:02:35 INFO /apps/svr/molten-debug/molten.c:626: molten request init
16:02:35 INFO /apps/svr/molten-debug/molten.c:670: molten request shutdown
16:02:35 INFO /apps/svr/molten-debug/molten_log.c:478: [sink] mo log flush
16:02:35 INFO /apps/svr/molten-debug/molten_log.c:527: [sink] mo log flush detail size:1149
16:02:35 INFO /apps/svr/molten-debug/molten_log.c:429: [sink] mo log write sink_type [0]
16:02:35 ERROR /apps/svr/molten-debug/molten_log.c:469: [sink] input error type [0]
from molten.
你本地有libcurl吗
from molten.
]$ rpm -qa| grep libcurl
libcurl-7.19.7-52.el6.x86_64
from molten.
curl-config 这个命令打印出来的是什么??
from molten.
debug 分支 我又修改一下, 你再试试看看打印出的数据
from molten.
17:13:21 INFO /apps/svr/molten-debug/molten.c:555: molten start
17:13:21 INFO /apps/svr/molten-debug/molten_log.c:197: [sink] current select sink_type:4, input type4
17:13:21 INFO /apps/svr/molten-debug/molten.c:626: molten request init
17:13:21 INFO /apps/svr/molten-debug/molten.c:670: molten request shutdown
17:13:21 INFO /apps/svr/molten-debug/molten_log.c:474: [sink] mo log flush
17:13:21 INFO /apps/svr/molten-debug/molten_log.c:523: [sink] mo log flush detail size:1147
17:13:21 INFO /apps/svr/molten-debug/molten_log.c:425: [sink] mo log write sink_type [4]
17:13:21 ERROR /apps/svr/molten-debug/molten_log.c:465: [sink] input error type [4]
from molten.
你应该没有安装libcurl-devel , 安装之后 再尝试一下
from molten.
同样的问题。没有任何输出。在centos 6 64bit上面php5.6 php7.0.20 都不行。
在centos7上面php7.0.20 是ok的。
在不行的机器上centos6 64bit php5.6下的molten debug的输出,没有任何traceId样的东西输出。
/usr/local/php/bin/php -d extension=molten.so -d molten.enable=1 -d molten.sink_type=2 -d molten.tracing_cli=1 -d molten.sampling_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten.c:555: molten start
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten_log.c:31: [sink][http] http data sender, post_uri:
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten_log.c:181: [sink] has libcurl
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten_log.c:197: [sink] current select sink_type:2, input type2
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten.c:626: molten request init
22:59:16 INFO /usr/local/zipkin/Molten-debug/molten.c:670: molten request shutdown
在centos 7 php7.0.20下是有输出的。是这样的
/usr/local/php/bin/php -d extension=molten.so - d molten.enable=1 -d molten.sink_type=2 -d molten.tracing_cli=1 -d molten.sampli ng_rate=1 -r '$c=curl_init("http://localhost:12345");curl_exec($c);'
23:10:00 INFO /root/Molten-debug/molten.c:555: molten start
23:10:00 INFO /root/Molten-debug/molten_log.c:31: [sink][http] http data sende r, post_uri:
23:10:00 INFO /root/Molten-debug/molten_log.c:181: [sink] has libcurl
23:10:00 INFO /root/Molten-debug/molten_log.c:197: [sink] current select sink_ type:2, input type2
23:10:00 INFO /root/Molten-debug/molten.c:626: molten request init
23:10:00 INFO /root/Molten-debug/molten.c:670: molten request shutdown
23:10:00 INFO /root/Molten-debug/molten_log.c:474: [sink] mo log flush
23:10:00 INFO /root/Molten-debug/molten_log.c:523: [sink] mo log flush detail size:1130
23:10:00 INFO /root/Molten-debug/molten_log.c:425: [sink] mo log write sink_ty pe [2]
[{"traceId":"816e7ea5368628f5","name":"php_curl","version":"php-4","id":"71a477f 3bb926fbd","parentId":"d409584881846d8f","timestamp":1506697800127731,"duration" :4592,"annotations":[{"value":"cs","timestamp":1506697800127731,"endpoint":{"ser viceName":"default","ipv4":"10.123.24.209"}},{"value":"cr","timestamp":150669780 0132323,"endpoint":{"serviceName":"default","ipv4":"10.123.24.209"}}],"binaryAnn otations":[{"key":"http.url","value":"http://localhost:12345/","endpoint":{"s erviceName":"default","ipv4":"10.123.24.209"}},{"key":"error","value":"Failed to connect to ::1: Network is unreachable","endpoint":{"serviceName":"default","ip v4":"10.123.24.209"}}]},{"traceId":"816e7ea5368628f5","name":"cli","version":"ph p-4","id":"d409584881846d8f","timestamp":1506697800112533,"duration":19877,"anno tations":[{"value":"sr","timestamp":1506697800112533,"endpoint":{"serviceName":" default","ipv4":"10.123.24.209"}},{"value":"ss","timestamp":1506697800132410,"en dpoint":{"serviceName":"default","ipv4":"10.123.24.209"}}],"binaryAnnotations":[ {"key":"path","value":"-","endpoint":{"serviceName":"default","ipv4":"10.123.24. 209"}}]}]
from molten.
11:07:23 INFO /usr/local/zipkin/Molten-debug/molten.c:555: molten start
11:07:23 INFO /usr/local/zipkin/Molten-debug/molten_log.c:31: [sink][http] http data sender, post_uri:
11:07:23 INFO /usr/local/zipkin/Molten-debug/molten_log.c:181: [sink] has libcurl
11:07:23 INFO /usr/local/zipkin/Molten-debug/molten_log.c:197: [sink] current select sink_type:2, input type2
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten.c:626: molten request init
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:163: sample 1
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:165: sample 2
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:167: sample 3
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:176: sample 6
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:189: sample 11
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:192: sample 12
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:197: sample 14
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_ctrl.c:227: sample 21
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten.c:670: molten request shutdown
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_log.c:474: [sink] mo log flush
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_log.c:523: [sink] mo log flush detail size:1135
11:07:24 INFO /usr/local/zipkin/Molten-debug/molten_log.c:425: [sink] mo log write sink_type [2]
好像是由于获取sample采样开关值没有匹配上。强制把pch.is_sample=1打开就可以了。
check hit ratio 函数srandom有bug总是返回0
from molten.
@reynaldliu
check hit ratio 函数srandom有bug 这个是什么意思?
from molten.
@silkcutKs ,这个 if (check_hit_ratio(prt->mcm->sampling_rate))
感觉好像有个pull request就是解决这个问题。
/* sampling rate */
if (prt->mcm->sampling_type == SAMPLING_RATE) {
if (check_hit_ratio(prt->mcm->sampling_rate)) {
pct->pch.is_sampled = 1;
} else {
pct->pch.is_sampled = 0;
}
}
from molten.
Related Issues (20)
- http://127.0.0.1:9411/zipkin/, 看不到任何链路信息 HOT 3
- PHP 7.4 support HOT 1
- php7.0.26 molten_set_traceid报错
- span name 不是很明确,是否可以支持自定义
- CentOS7 phpize报错 HOT 3
- CLI模式可以正常上报数据,SAPI模式(php-fpm)不上报 HOT 3
- 日志这种分配栈内存的方式,导致在cli模式下出现段错误,OOM错误
- ElasticSearch的GET请求body被丢弃。
- 微信群二维码已经过期了可以更新下吗? HOT 2
- 安装时执行make报错 HOT 1
- phaclon molten_set_traceid($trace_id) error HOT 1
- mac os 10.13.6 编译安装make 报错 unknown type name 'ulong' HOT 1
- 是否支持修改或者添加span的tags,logs等字段的值?
- 是否支持phalcon+swoole模式的应用?是否与其他扩展冲突? HOT 3
- PHP7.4 Install Molten Extension compiler error HOT 1
- php7.4 make install error HOT 1
- php5.6,能看curl,file_get_contents信息,为什么mysql,memcached 等信息看不到 HOT 2
- php74 不支持
- Question mark in SQL HOT 1
- php74支持
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from molten.