pinpoint-apm / pinpoint-c-agent

It is an agent written by C++, PHP, python languages. And we hope to support other languages by this agent. Until now, it supports [PHP],[C/C++], [PYTHON] and [GO].
http://pinpoint-apm.github.io/pinpoint/
Apache License 2.0
260 stars 75 forks source link

way to fetch data from pinpoint collector using python #574

Closed sanatan90 closed 3 months ago

sanatan90 commented 5 months ago

Is your feature request related to a problem? Please describe. There is no clear documents for fetching data collected by Pinpoint collector using python

Describe the solution you'd like How to retrieve data from Pinpoint collector through Python

eeliu commented 5 months ago

pinpoint-c-agent, it's an agent. Does not need to fetch data from Pinpoint collector.

sanatan90 commented 5 months ago

We need to show the monitoring data related to application monitoring on our own django application. Hence @eeliu can you please suggest how to achieve this.

eeliu commented 5 months ago

Can you give me some example ?
I can't get it

sanatan90 commented 5 months ago

We want to show application monitoring graphs on our own website which is a django application(python). How do we get these graph data as there is no REST api support available. Is there any alternative to get the graph data?

eeliu commented 5 months ago

Do you mean the background task or some user defined entry function ?

If that, use @PinTransaction

E.g.

https://github.com/pinpoint-apm/pinpoint-c-agent/blob/618a54628c8f18f5b3a47ef48772e97eaa5d54f6/plugins/PY/pinpointPy/libs/_MySQLdb/test_case.py#L14C6-L21

sanatan90 commented 5 months ago

Is there any example where we can use this python agent to perform monitoring for a specific vm using IP address? @eeliu

The previous link shared by you is about fetching mysql DB data. But we are looking how to fetch data which shows on Pinpoint web console(Graph data) for a docker container or Virtual machine. I hope this gives more clarity on our requirement.

eeliu commented 5 months ago

python agent is just an pinpoint client, it just collects data and uploads to collector-agent.

python agent to perform monitoring for a specific vm using IP address?

What's that meaning?

sanatan90 commented 5 months ago

@eeliu Thanks for the suggestions so far. Here I have tried to explain the full scenario.

We have setup pinpoint collector using docker-compose file as mentioned in the doc: https://computingforgeeks.com/deploy-pinpoint-apm-in-docker-containers/

After following all the steps we are able to setup properly and can see the pinpoint web console 10.10.10.100:8080. we are able to see the quick app generated through docker-compose file and its related metrics and graphs.

These are the docker containers which we have setup is running image

Now we have a django application running in another server with ip: 10.10.10.101 and we have installed pinpoint-c-agent using this document: https://github.com/pinpoint-apm/pinpoint-c-agent/blob/dev/DOC/collector-agent/readme.md.

And added required configuration in the django application using this doc: https://github.com/pinpoint-apm/pinpoint-c-agent/blob/dev/DOC/PY/Readme.md#12-django

We need clarity for this config: set_agent("cd.dev.test.py", "cd.dev.test.py", 'tcp:dev-collector:10000', -1, logging.DEBUG). What's the dev-collector refers? Is it the pinpoint collector ip: 10.10.10.100 or django application server ip: 10.10.10.101 where collector-agent is installed and running?

We are following this approach, if this is not the best practice, please suggest how can we get our django application(10.10.10.101) to be monitored, on pinpoint collector (10.10.10.100)

eeliu commented 5 months ago

dev-collector , it's the hostname/domain for collector-agent.

you can use playground

sanatan90 commented 5 months ago

Hi @eeliu , We tried the steps as mentioned by you from playground. But while running this command docker compose up --build getting below error.

image

Can you please guide us how to resolve this?

eeliu commented 5 months ago

Thanks your report https://github.com/pinpoint-apm/pinpoint-c-agent/issues/574#issuecomment-1929844204 fixed by https://github.com/pinpoint-apm/pinpoint-c-agent/pull/578

sanatan90 commented 4 months ago

@eeliu After resolving the above mentioned issue we are able to successfully deploy the application, but all the test apps are not up. I have attached the screenshot for reference.

image

Just need to check if anyone is available for providing consultation on pinpoint on contract basis also, please let us know. We can connect and discuss.

sanatan90 commented 4 months ago

Anyone who is available to work with us for pinpoint agent installation on django application consultation on contract basis, please let us know. @eeliu , @ofauchon , @xujunhai , @eugene70

eeliu commented 4 months ago

Can you share the logging to us ?

docker logs "your django container id"

suhail-linux commented 4 months ago

Hello @eeliu ,

There are no logs related to the django container, however what i assume is this problem is occurring because I have installed PinPoint via quick-start on same VM, i have installed same testapp in different VM it got installed without any issue.

Can you please help on below query/doubt. 1) Let's say i have VM where we are running the applications (Pytho django app), and we have installed pinpoint-c-agent, so is this enough to communicate with Pin-Point server or do we need to install again pinpoint-agent also on same VM.

image
eeliu commented 4 months ago

@suhail-linux

as for python, collect-agent is a must. how to ? image

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 5 days with no activity.