Closed killen9 closed 3 months ago
why "appid":"no","appname":"no ?
it's an old setting, deprecated now. (agent information can be set at collector-agent side)
how setting?
Please tell me how to set up the collector-agent.
https://github.com/pinpoint-apm/pinpoint-c-agent/blob/dev/DOC/collector-agent/readme.md
define('APPLICATION_NAME','php');
define('APPLICATION_ID','2');
what?
.bash_profile
export PP_COLLECTOR_AGENT_SPAN_IP=127.0.0.1 export PP_COLLECTOR_AGENT_SPAN_PORT=9993 export PP_COLLECTOR_AGENT_AGENT_IP=127.0.0.1 export PP_COLLECTOR_AGENT_AGENT_PORT=9991 export PP_COLLECTOR_AGENT_STAT_IP=127.0.0.1 export PP_COLLECTOR_AGENT_STAT_PORT=9992 export PP_COLLECTOR_AGENT_ISDOCKER=false export PP_LOG_DIR=/app/pinpoint/logs export PP_Log_Level=INFO export PP_ADDRESS=0.0.0.0@9999
php.ini
[pinpoint_php] extension = pinpoint_php.so pinpoint_php.CollectorHost = tcp:211.45.120.7:9999 pinpoint_php.SendSpanTimeOutMs = 0 pinpoint_php.TraceLimit = -1 pinpoint_php.DebugReport = true
[error_log] error_reporting = E_ALL
error_log = /var/log/php/php-error.log
common.php
##############PINPOINT########################### require_once DIR.'/../vendor/autoload.php'; define('APPLICATION_NAME','GNB'); define('APPLICATION_ID','2'); define('AOP_CACHE_DIR',DIR.'/../Cache/'); define('PLUGINS_DIR',DIR.'/../Plugins/'); define('PINPOINT_USE_CACHE','YES'); require_once DIR.'/../vendor/pinpoint-apm/pinpoint-php-aop/auto_pinpointed.php'; #################################################
Is it different?
It is not registered on the web and cannot be connected to pinpoint-collector.
Please attach the output of php agent.
https://github.com/pinpoint-apm/pinpoint-c-agent/blob/dev/testapps/PHP/php.ini
Does your pinpoint-collector locate at "PP_COLLECTOR_AGENT_SPAN_IP=127.0.0.1" ?
It is installed locally.
collector-agent / pinpoint-collector is installed locally.
collector.log
[2024-04-15 13:56:50.024840042] INFO client:10.0.0.167:35716 is online [2024-04-15 13:56:50.024928028] INFO send handshake msg:{"appid":"no","appname":"no","time":"1713141240"}
why "appid":"no","appname":"no ?
Please tell me how to set up the collector-agent.
it looks collector-agent woks fine.
collector.log
[2024-04-15 17:10:43.110591367] INFO client:127.0.0.1:50806 is online [2024-04-15 17:10:43.110772605] INFO send handshake msg:{"appid":"no","appname":"no","time":"1713165831"} [2024-04-15 17:10:43.111114644] WARN no FT [2024-04-15 17:10:43.111140757] WARN dispather packet with an exception: no FT [2024-04-15 17:10:43.111154559] WARN parseInComePacket catches error:no FT,client:127.0.0.1:50806 [2024-04-15 17:10:43.11116987] INFO connection:127.0.0.1:50806 is shutdown
why isn't registered on the web?
Enable "log_errors= On " and share us the logging of your php application. https://github.com/pinpoint-apm/pinpoint-c-agent/blob/1bdfc706adc9cd44e93a9e6b08bd32fe1c6f685b/testapps/PHP/php.ini#L9
no logging
collector.log
[2024-04-15 17:51:14.645184858] INFO client:10.0.0.167:60632 is online [2024-04-15 17:51:14.645371276] INFO send handshake msg:{"appid":"no","appname":"no","time":"1713171031"} [2024-04-15 17:51:14.64558775] DEBUG size: 275 packetType: 1 body:{":E":252,":FT":1500,":S":1713171074392,"appid":"php-1","appname":"GNB","client":"192.168.10.20","clues":["46:200"],"name":"PHP Request: fpm-fcgi","server":"10.0.0.167","sid":"1718730853","stp":"1500","tid":"php-1^1713171066709^0","uri":"/gnuboard/bbs/board.php?bo_table=qa"} [2024-04-15 17:51:14.645708234] WARN no FT [2024-04-15 17:51:14.645762668] WARN dispather packet with an exception: no FT [2024-04-15 17:51:14.645790138] WARN parseInComePacket catches error:no FT,client:10.0.0.167:60632 [2024-04-15 17:51:14.645831342] INFO connection:10.0.0.167:60632 is shutdown
collector.log
[2024-04-15 17:51:14.645184858] INFO client:10.0.0.167:60632 is online [2024-04-15 17:51:14.645371276] INFO send handshake msg:{"appid":"no","appname":"no","time":"1713171031"} [2024-04-15 17:51:14.64558775] DEBUG size: 275 packetType: 1 body:{":E":252,":FT":1500,":S":1713171074392,"appid":"php-1","appname":"GNB","client":"192.168.10.20","clues":["46:200"],"name":"PHP Request: fpm-fcgi","server":"10.0.0.167","sid":"1718730853","stp":"1500","tid":"php-1^1713171066709^0","uri":"/gnuboard/bbs/board.php?bo_table=qa"} [2024-04-15 17:51:14.645708234] WARN no FT [2024-04-15 17:51:14.645762668] WARN dispather packet with an exception: no FT [2024-04-15 17:51:14.645790138] WARN parseInComePacket catches error:no FT,client:10.0.0.167:60632 [2024-04-15 17:51:14.645831342] INFO connection:10.0.0.167:60632 is shutdown
Try the latest collector-agent .
docker pull ghcr.io/pinpoint-apm/pinpoint-c-agent/collector-agent:0.5.0
please update the collector-agent
don't go build
[pin@Zenius collector-agent]$ go build common/config.go:9:2: no required module provides package github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1; to add it: go get github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1
make error
[pin@Zenius collector-agent]$ make protoc --go_out=pinpoint-grpc-idl/proto/ --go-grpc_out=pinpoint-grpc-idl/proto --proto_path=pinpoint-grpc-idl/proto/ --go-grpc_opt=paths=source_relative v1/Annotation.proto v1/Cmd.proto v1/CustomMetric.proto v1/Service.proto v1/Span.proto v1/Stat.proto v1/ThreadDump.proto google/protobuf/wrappers.proto: File not found. v1/Annotation.proto: Import "google/protobuf/wrappers.proto" was not found or had errors. v1/Annotation.proto:15:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:20:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:21:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:26:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:27:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:36:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:47:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:48:5: "google.protobuf.StringValue" is not defined. make: *** [makefile:8: protoc] Error 1
you missed the submodule
git clone --recurse-submodules https://github.com/pinpoint-apm/pinpoint-c-agent.git
fail
please check the dockerfile of collector-agent https://github.com/pinpoint-apm/pinpoint-c-agent/blob/dev/collector-agent/Dockerfile
Script for compile collector-agent
...
apk add make protobuf-dev
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
...
what's mean?
i'm not use docker.
[root@Zenius collector-agent]# go build common/config.go:9:2: no required module provides package github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1; to add it: go get github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1
Dockerfile?
apk?
[root@Zenius collector-agent]# apk add --no-cache make protobuf-dev bash: apk: command not found...
????
I want to install it as server, not as docker
CentOS Linux release 8.5.2111
I tried by docker of centos 8 ,while it's EOL.
Here is checklist:
[root@Zenius pin]# go version go version go1.22.0 linux/amd64 [root@Zenius pin]# protoc --version libprotoc 3.5.0
how about "go install" ?
(venv) pinpoint@pinpoint:/workspace/collector-agent$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go: downloading google.golang.org/protobuf v1.33.0 go: downloading google.golang.org/grpc v1.63.2
[root@Zenius app]# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest go: downloading google.golang.org/protobuf v1.33.0 go: downloading google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 go: downloading google.golang.org/grpc v1.63.2 go: downloading google.golang.org/protobuf v1.28.1
i think this link is problem.
no required module provides package github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1
hmm, how about this command ?
protoc --go_out=pinpoint-grpc-idl/proto/ --go-grpc_out=pinpoint-grpc-idl/proto --proto_path=pinpoint-grpc-idl/proto/ --go-grpc_opt=paths=source_relative v1/Annotation.proto v1/Cmd.proto v1/CustomMetric.proto v1/Service.proto v1/Span.proto v1/Stat.proto v1/ThreadDump.proto
[root@Zenius collector-agent]# protoc --go_out=pinpoint-grpc-idl/proto/ --go-grpc_out=pinpoint-grpc-idl/proto --proto_path=pinpoint-grpc-idl/proto/ --go-grpc_opt=paths=source_relative v1/Annotation.proto v1/Cmd.proto v1/CustomMetric.proto v1/Service.proto v1/Span.proto v1/Stat.proto v1/ThreadDump.proto google/protobuf/wrappers.proto: File not found. v1/Annotation.proto: Import "google/protobuf/wrappers.proto" was not found or had errors. v1/Annotation.proto:15:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:20:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:21:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:26:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:27:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:36:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:47:5: "google.protobuf.StringValue" is not defined. v1/Annotation.proto:48:5: "google.protobuf.StringValue" is not defined.
try https://gist.github.com/olivoil/a2e0e4f3427db8b6ef4a6374f9c4cb32
backup the old one, if you need
[root@Zenius collector-agent]# make protoc --go_out=pinpoint-grpc-idl/proto/ --go-grpc_out=pinpoint-grpc-idl/proto --proto_path=pinpoint-grpc-idl/proto/ --go-grpc_opt=paths=source_relative v1/Annotation.proto v1/Cmd.proto v1/CustomMetric.proto v1/Service.proto v1/Span.proto v1/Stat.proto v1/ThreadDump.proto protoc-gen-go: program not found or is not executable --go_out: protoc-gen-go: Plugin failed with status code 1. make: *** [makefile:8: protoc] Error 1 [root@Zenius collector-agent]# go build common/config.go:9:2: no required module provides package github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1; to add it: go get github.com/pinpoint-apm/pinpoint-c-agent/collector-agent/pinpoint-grpc-idl/proto/v1 [root@Zenius collector-agent]# protoc --version libprotoc 3.5.0 [root@Zenius collector-agent]#
.bash_profile add
export GOROOT=/usr/local/go export GOPATH=$HOME/go export GOBIN=$GOPATH/bin export PATH=$PATH:$GOROOT:$GOPATH:$GOBIN
and compile success
DB information cannot be retrieved.
which php framework you used ?
i'm not used framework.
by the way, which mysql client used? just pdo ?
php-agent does not support c-level plugins yet, if used yii,
\yii\db\Connection
isJoinPoint
[root@Zenius lib]# pwd /app/mysql/lib [root@Zenius lib]# ls libmariadbclient.a libmariadb.so libmariadb.so.3 libmysqlclient.a libmysqlclient_r.a libmysqlclient_r.so libmysqlclient.so libmysqlservices.a pkgconfig plugin
why not call tree?
As c-level function does not support yet, I will re-implement all plugins to support c-level in future.
sorry
I don't know how to create a custom plugin. I'm just an operator, not a developer. Can you tell me how to set it up?
@killen9
I find your project does not follow the psr-4
, that means you can't use this version, even the custom plugin.
Ref
I tag this issue into next major version.
In addition to db information, I also want to display call-tree (trace) information and mem information. I would appreciate your help.
##############PINPOINT########################### require_once DIR.'/../vendor/autoload.php'; define('APPLICATION_NAME','php'); define('APPLICATION_ID','2'); define('AOP_CACHE_DIR',DIR.'/../Cache/'); define('PLUGINS_DIR',DIR.'/../Plugins/'); define('PINPOINT_USE_CACHE','YES'); require_once DIR.'/../vendor/pinpoint-apm/pinpoint-php-aop/auto_pinpointed.php'; #################################################
collector.log
[2024-04-15 13:56:50.024840042] INFO client:10.0.0.167:35716 is online [2024-04-15 13:56:50.024928028] INFO send handshake msg:{"appid":"no","appname":"no","time":"1713141240"}
why "appid":"no","appname":"no ?