Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skywalking-python not trace request #5285

Closed
shuguang-dong opened this issue Aug 10, 2020 · 8 comments
Closed

skywalking-python not trace request #5285

shuguang-dong opened this issue Aug 10, 2020 · 8 comments
Assignees
Labels
agent Language agent related. python Python agent related question End user question and discussion.

Comments

@shuguang-dong
Copy link

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion

Question

  • I learn skywalking-python by this page: https://github.com/apache/skywalking-python
    after agent.start(),only create instance,but not track any request.
    when agent.start(), I also start my django server and request some api, then I view skywalking admin page,only see instance created but not trace any request info.

My fremework info:

  • Python-3.7
  • Djano-2.1.3
  • skywalking-python-0.2.0
@wu-sheng wu-sheng added agent Language agent related. python Python agent related labels Aug 10, 2020
@wu-sheng wu-sheng modified the milestones: 8.2.0, PythonAgent 0.3.0 Aug 10, 2020
@kezhenxu94
Copy link
Member

@shuguang-dong please set the logging level(config.logging_level) to DEBUG and paste your logs here

@kezhenxu94
Copy link
Member

Perhaps you just hit the incompatibility of Django plugin, which is fixed in the master branch but not included in the 0.2.0, if possible, please try to build from the master branch codes and tell us whether it helps, or try a newer Django version (> 2.2), thanks

@shuguang-dong
Copy link
Author

This is my code:

from skywalking import agent, config

config.init(
    service='shenlong-kol',
    instance='dev-local',
    collector='my sky walking address',
)
agent.start()

and I debug it in pycharm ,here is log:

sw_flask                         [MainThread     ] [WARNING ] failed to install plugin sw_flask
sw_kafka                         [MainThread     ] [WARNING ] failed to install plugin sw_kafka
sw_tornado                       [MainThread     ] [WARNING ] failed to install plugin sw_tornado

I will also try a newer Django version(>2.2) again

@alonelaval
Copy link
Member

alonelaval commented Aug 10, 2020

I tested Django==3.1, apache-skywalking==0.2.0. it worked well @shuguang-dong

import sys
import time

from skywalking import agent, config

from django.conf import settings
from django.conf.urls import url
from django.http import JsonResponse


config.service_name = "provider"
config.logging_level = "DEBUG"
agent.start()


settings.configure(
    DEBUG=True,
    ROOT_URLCONF=__name__,
    ALLOWED_HOSTS=['*'],
)


def index(request):
    time.sleep(0.5)
    return JsonResponse({"song": "Despacito", "artist": "Luis Fonsi"})


urlpatterns = (
    url("users", index),
)


if __name__ == "__main__":
    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

cmd: python3 test_django.py runserver 0.0.0.0:9090

@wu-sheng
Copy link
Member

I think the key may be this I will also try a newer Django version(>2.2) again

@kezhenxu94
Copy link
Member

I tested Django==3.1, apache-skywalking==0.2.0. it worked well @shuguang-dong

import sys
import time

from skywalking import agent, config

from django.conf import settings
from django.conf.urls import url
from django.http import JsonResponse


config.service_name = "provider"
config.logging_level = "DEBUG"
agent.start()


settings.configure(
    DEBUG=True,
    ROOT_URLCONF=__name__,
    ALLOWED_HOSTS=['*'],
)


def index(request):
    time.sleep(0.5)
    return JsonResponse({"song": "Despacito", "artist": "Luis Fonsi"})


urlpatterns = (
    url("users", index),
)


if __name__ == "__main__":
    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

cmd: python3 test_django.py runserver 0.0.0.0:9090

It's quite expected because we run the test cases over and over in the CI, and I'm pretty sure it's just a version incompatibility issue fixed by @Humbertzhang in apache/skywalking-python#52 in the master branch now(not included in the 0.2.0), I'll close this for now and if you @shuguang-dong have any further question, please comment here

@kezhenxu94 kezhenxu94 added the question End user question and discussion. label Aug 10, 2020
@wu-sheng
Copy link
Member

@kezhenxu94 I think python agent should follow the java supported list doc style, add versions there.

@kezhenxu94
Copy link
Member

@kezhenxu94 I think python agent should follow the java supported list doc style, add versions there.

Versioning the supported libraries as well as the tests is under construction by @Humbertzhang and I, will open another issue to track that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. python Python agent related question End user question and discussion.
Projects
None yet
Development

No branches or pull requests

4 participants