skyapm / skyapm-php-sdk Goto Github PK
View Code? Open in Web Editor NEWReplaced by https://github.com/apache/skywalking-php
Home Page: https://skywalking.apache.org/
License: Apache License 2.0
Replaced by https://github.com/apache/skywalking-php
Home Page: https://skywalking.apache.org/
License: Apache License 2.0
Warning: PHP Startup: Unable to load dynamic library '/alidata/server/php-7.1.19/lib/php/extensions/no-debug-non-zts-20160303/skywalking.so' - /alidata/server/php-7.1.19/lib/php/extensions/no-debug-non-zts-20160303/skywalking.so: undefined symbol: _ZTIN6google8protobuf7MessageE in Unknown on line 0
php.ini加处skywalking扩展;curl请求外部资源出现502。
配置如下:
[skywalking]
;扩展so
extension=skywalking.so
;是否启用:0 关闭;1 启用 (默认值为0)
skywalking.enable=1
;skywalking的版本:5或者6(默认值为6)
skywalking.version=6
;app_code代码,不要含特殊字符,请使用数字、字母、下换线。(默认为:hello_skywalking)
skywalking.app_code=hello_skywalking
;sock文件路径(默认值为/tmp/sky_agent.sock)
skywalking.sock_path=/tmp/sky_agent.sock
php error.log
[24-Jul-2019 20:56:18] WARNING: [pool www] child 29451 exited on signal 11 (SIGSEGV) after 25.828844 seconds from start
[24-Jul-2019 20:56:18] NOTICE: [pool www] child 29558 started
php 代码:
Is there any plan to support swoft or swoole ?
我按照install-agent.md文档进行了安装,但是不知道如何使用这个探针,在控制台只显示了一个hello。
report_client 172.26.112.220:11800
Segmentation fault
这是什么情况。我的是skywalking 是6的版本。用的fpm。
Some errors occurred during compiling the report_client.
report_client.cpp:26:28: fatal error: boost/format.hpp: No such file or directory
#include <boost/format.hpp>
^
compilation terminated.
make: *** [report_client] Error 1
如题,支持哪些版本php,老版本5.6现在到底支持不?
I found that some things of GA-6.0 were not completed.
Is it usable?
I am new to skywalking and am trying to install the Skywalking php agent. i am following the given document in the SkyAPM-php-sdk. However after cloning the repository when i try to execute the command - " phpize && ./configure && make && make install " it give the following error :-
/home/indraneel/SkyAPM-php-sdk/src/greeter_client.cc:25:10: fatal error: grpc/register/Register.grpc.pb.h: No such file or directory
#include "grpc/register/Register.grpc.pb.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
I installed gRPC as per the instructions given in the installation documents. I can't seem to find the Register.grpc.pb.h file anywhere. Please can someone help me get a clearer idea of what exactly this file is and where can i find it?
Say I have project A writing in PHP, and project B writing in JAVA, A call B via curl, both A AND B use skywalking, but in Topology they are not connected and in Traces they are not work together.
你好:
我的生产环境是php7.2+gcc 4.7.4
编译时候的环境是gcc6.x,编译出来的.so扩展添加到php.ini,报出segementation fault错误,php-fpm无法启动,没有其他错误信息了,请问是否要求php本身的编译环境也要相同于agent?
IMHO, for an open source project, the community environment is the most important thing. So please make sure, every people who are interesting in your repository, know who you are, and how to contact you.
So at least provide your information for contacting you. At least, if you want to make things easier, you can use Skywalking's gitter room, google maillist, QQ group, etc. Bottom line is, people can talk with you, and provide you their feedback. Then you know how to improve your project. That is how does an open source project work out.
Is it supports skywalking 6.x now?
skyAPM-php-sdk的链路图可以支持下mysql和redis吗? 大佬辛苦
tag: 2.0.1
g++ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/opt/SkyAPM-php-sdk -DPHP_ATOM_INC -I/opt/SkyAPM-php-sdk/include -I/opt/SkyAPM-php-sdk/main -I/opt/SkyAPM-php-sdk -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/opt/SkyAPM-php-sdk/src/grpc -DHAVE_CONFIG_H -std=c++11 -Isrc/report/deps/boost -c /opt/SkyAPM-php-sdk/src/greeter_client.cc -fPIC -DPIC -o src/.libs/greeter_client.o
/opt/SkyAPM-php-sdk/src/greeter_client.cc:25:53: fatal error: grpc/ApplicationRegisterService.grpc.pb.h: No such file or directory
#include "grpc/ApplicationRegisterService.grpc.pb.h"
^
compilation terminated.
make: *** [src/greeter_client.lo] Error 1
php-fpm /etc/init.d/php-fpm: line 54: 2236313 Segmentation fault $php_fpm_BIN --daemonize $php_opts
hecking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /opt/rh/devtoolset-4/root/usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /tmp/php
checking for PHP includes... -I/tmp/php/include/php -I/tmp/php/include/php/main -I/tmp/php/include/php/TSRM -I/tmp/php/include/php/Zend -I/tmp/php/include/php/ext -I/tmp/php/include/php/ext/date/lib
checking for PHP extension directory... /tmp/php/lib/php/extensions/no-debug-zts-20151012
checking for PHP installed headers prefix... /tmp/php/include/php
checking if debug is enabled... no
checking if zts is enabled... yes
checking for re2c... re2c
checking for re2c version... 0.14.3 (ok)
checking for gawk... gawk
checking whether to enable skywalking support... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld
checking if the linker (/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld) is GNU ld... yes
checking for /opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld option to reload object files... -r
checking for BSD-compatible nm... /opt/rh/devtoolset-4/root/usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 1572864
checking command to parse /opt/rh/devtoolset-4/root/usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld -m elf_x86_64
checking if the linker (/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: executing default-1 commands
./src/protos/.proto: No such file or directory
./src/protos/.proto: No such file or directory
config.status: executing default-2 commands
mv: cannot stat 'src/grpc/ApplicationRegisterService.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/Common.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/DiscoveryService.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/Downstream.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/JVMMetricsService.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/KeyWithIntegerValue.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/KeyWithStringValue.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/NetworkAddressRegisterService.grpc.pb.cc': No such file or directory
mv: cannot stat 'src/grpc/TraceSegmentService.grpc.pb.cc': No such file or directory
You link php-sdk document to Skywalking WIKI in this section: https://github.com/SkywalkingContrib/skywalking-php-sdk#wiki文档
BTW, I will close skywalking WIKI soon, and use /docs
folder in source codes instead. The reason I am going to do this, is that makes people possible to fix document by pull request. That will make you to cost less time for fixing documents typo.
跟踪 report 进程,显示服务端 timeout.
As you known, OpenSkywalking and its team work in the global env. So many out-China guys pay attentions to our projects and related ecosystem, like your php-sdk
.
README.md
, and Chinese in README_ZH.md
.You can see that in Skywalking repository. And when you set a mirror in OSChina, like we did: https://gitee.com/OpenSkywalking/sky-walking , I will find out they follow this rule too, they choose the *_ZH.md as default readme, since their users are Chinese, right.
send /tmp/skywalking.1557798374-5642.log
to skywalking service
send 4.5642.15577983730010 to skywalking service
terminate called after throwing an instance of 'nlohmann::detail::type_error'
what(): [json.exception.type_error.302] type must be number, but is array
Aborted
Docker apache/skywalking:6.2
SkyAPM-php-sdk:3.1.1
PHP Version 7.2.15 FPM
Can only view the HttpClient, won't be able to see the MYSQL database information.
The current version does not support?
php-fpm: v7.2.7 zts
extension=skywalking.so
skywalking.enable=1
skywalking.version=6
skywalking.app_code=hello_skywalking
skywalking.sock_path=/tmp/sky_agent.sock
Jul 29 17:16:26 applicaton-proving systemd: Started The PHP FastCGI Process Manager.
Jul 29 17:16:26 applicaton-proving systemd: Starting The PHP FastCGI Process Manager...
Jul 29 17:16:26 applicaton-proving kernel: php-fpm[32446]: segfault at 0 ip 00007fe15f910cca sp 00007ffcba47f3d0 error 4 in skywalking.so[7fe15f90c000+9000]
Jul 29 17:16:26 applicaton-proving systemd: php-fpm.service: main process exited, code=killed, status=11/SEGV
Jul 29 17:16:26 applicaton-proving systemd: Unit php-fpm.service entered failed state.
Jul 29 17:16:26 applicaton-proving systemd: php-fpm.service failed.
// download report_client_linux
wget https://github.com/..... && cp report_client_linux report_client /usr/bin
hello skywalking
使用的最新版本的
https://github.com/SkyAPM/SkyAPM-php-sdk/releases/download/3.1.2/sky_php_agent_linux_x64
php.ini 也正常
skywalking 6+。
That is your major documents, please provide it.
after install the skywalking,so in /php/ext/ directory,I run: php -m, the " symbol lookup error: /usr/local/whistle/php/ext/skywalking.so: undefined symbol: uuid_generate_random" happened.
I have tried my best to resolve this problem,but failed.
I need ur help,please.
root@ubuntu-30-29:/data/SkyAPM-php-sdk# make
/bin/bash /data/SkyAPM-php-sdk/libtool --mode=compile cc -Wall -Werror -std=c++11 -I. -I/data/SkyAPM-php-sdk -DPHP_ATOM_INC -I/data/SkyAPM-php-sdk/include -I/data/SkyAPM-php-sdk/main -I/data/SkyAPM-php-sdk -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -I/data/SkyAPM-php-sdk/src/report/deps/boost -I/data/SkyAPM-php-sdk/src/grpc -I/data/SkyAPM-php-sdk/src -DHAVE_CONFIG_H -g -O2 -c /data/SkyAPM-php-sdk/skywalking.c -o skywalking.lo
libtool: compile: cc -Wall -Werror -std=c++11 -I. -I/data/SkyAPM-php-sdk -DPHP_ATOM_INC -I/data/SkyAPM-php-sdk/include -I/data/SkyAPM-php-sdk/main -I/data/SkyAPM-php-sdk -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -I/data/SkyAPM-php-sdk/src/report/deps/boost -I/data/SkyAPM-php-sdk/src/grpc -I/data/SkyAPM-php-sdk/src -DHAVE_CONFIG_H -g -O2 -c /data/SkyAPM-php-sdk/skywalking.c -fPIC -DPIC -o .libs/skywalking.o
cc1: error: command line option '-std=c++11' is valid for C++/ObjC++ but not for C [-Werror]
cc1: all warnings being treated as errors
make: *** [skywalking.lo] Error 1
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
PHP project has more attention today. Please set up CI(Travis or CircleCI), and think about how to test the plugins.
As you mentioned, this sdk supported to write data into logs, but you miss the part about how to uplink these logs to the skywalking collector, and the UI visualization.
This is an important documents for end users.
建议 建立一个基于 alpine-nginx-php7 的docker image,可以向java 版学习
in configure, try to rename such files:
grpc/greeter_client.cc \
grpc/DiscoveryService.pb.cc \
grpc/DiscoveryService-grpc.pb.cc \
grpc/ApplicationRegisterService.pb.cc \
grpc/ApplicationRegisterService-grpc.pb.cc \
grpc/TraceSegmentService.pb.cc \
grpc/TraceSegmentService-grpc.pb.cc
,but in dir grpc, there is no such files.
问题如标题
能上传日志了,但是有个问题。nginx报错,有些接口返回正常,个别接口请求返回 502. 不是因为超时,nginx日志如下:
2019/07/20 11:36:23 [error] 7#7: *856 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /place/search HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"
杀掉report_client进程,接口请求都是正常的。
其中一个返回502的接口是请求elastic search,search索引。用的是官方的es-php sdk。
目前看,有问题的接口,都是涉及到请求第三方的服务。
线上系统一般存在通过指定url的http状态监测,来做服务探活,会生成大量的追踪信息
send /tmp/skywalking.1557797862-3966.log
to skywalking service
send 4.3966.15577978600012 to skywalking service
terminate called after throwing an instance of 'nlohmann::detail::type_error'
what(): [json.exception.type_error.305] cannot use operator[] with a string argument with array
Aborted
I know I can get traceId and log it in Java. But with php sdk, how can I do this?
We put all logs in es and get all the call chain logs by searching traceId.
Thanks.
OS
# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
php
# php -v
PHP 7.2.14 (cli) (built: Mar 12 2019 17:13:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.14, Copyright (c) 1999-2018, by Zend Technologies
# php -i | grep sky
/etc/php.d/skywalking.ini
skywalking
SkyWalking Agent => /tmp/sky_agent.sock
skywalking.app_code => MyProjectName => MyProjectName
skywalking.enable => On => On
skywalking.grpc => 127.0.0.1:11800 => 127.0.0.1:11800
skywalking.log_path => /tmp => /tmp
skywalking.version => 6 => 6
netstat
# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 14877/httpd
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 32957/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9640/sshd
tcp 0 0 0.0.0.0:11800 0.0.0.0:* LISTEN 32940/java
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 10340/master
tcp 0 0 0.0.0.0:12800 0.0.0.0:* LISTEN 32940/java
apache-skywalking-apm-bin-6.2.0 is used by default
https://github.com/apache/skywalking/blob/v6.2.0/docs/en/setup/backend/backend-ui-setup.md
# ./apache-skywalking-apm-bin-6.2.0/bin/startup.sh
SkyWalking OAP started successfully!
SkyWalking Web Application started successfully!
netcat
# nc -v 127.0.0.1 11800
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:11800.
XHTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 0a
Ncat: Broken pipe.
sky_php_agent version3.1.0
# ./sky_php_agent_linux_x64-3.1.0 127.0.0.1:11800
hello skywalking
.....
.....(Nothing is displayed)
strace
# strace -p $(pgrep sky_php_agent)
strace: Process 15391 attached
restart_syscall(<... resuming interrupted futex ...>) = -1 ETIMEDOUT (Connection timed out)
futex(0xc44950, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xc0001044c0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xc485e0, FUTEX_WAIT_PRIVATE, 0, {39, 999999084}) = -1 ETIMEDOUT (Connection timed out)
futex(0xc44950, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xc0001044c0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xc48660, FUTEX_WAIT_PRIVATE, 0, {39, 999998788}^Cstrace: Process 15391 detached
<detached ...>
FUTEX_WAIT_PRIVATE ETIMEDOUT (Connection timed out) is displayed infinitely
I am in trouble because I do not know the reason
I hope you can help 🙇
在老的版本里,编译可以通过,使用没问题。最新的版本,发现编译报错。
我使用时通过的版本号是:1cbabdc742ce43fdacb32759f4108754094139011cbabdc742ce43fdacb32759f410875409413901
编译报错的php版本:7.1.18
报错信息是:
/home/soft/SkyAPM-php-sdk/skywalking.c: 在函数‘sky_execute_internal’中: /home/soft/SkyAPM-php-sdk/skywalking.c:415:56: 错误:‘MYSQLND_CONN_DATA’没有名为‘host’的成员 char *host = mysql->mysql->data->host;
skywalking 6.1
skyAPM-php-sdk
git clone last version 20190520
php -i
skywalking Support => disabled (register fail)
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.