Skip to content

[Python] Apache Skywalking, flask uwsgi, no metrics send to server #6324

@MichaelProjects

Description

@MichaelProjects

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
    Because I like apache skywalking and it's really annoying
  • Question or discussion
    So the following issue is, if I run my flask app with a normal "python3 run.app" and call an endpoint, then it will send the needed metrics to the aop server(it runs in a docker container) but if i run my app with uwsgi, then it wont send the needed metrics to the server.
  • Bug
    Flask==1.1.2
    apache-skywalking[http]==0.5.0
  • Requirement
  • Feature or performance improvement

Question

  • What do you want to know?

Bug

serverlog:
contentservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Contentservice], [dc037ddc672111eb94ef0242c0a8f002]
imageservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Imageservice], [dc0047ac672111eba89e0242c0a8f003]
userservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Userservice], [dbbe190e672111eb95d70242c0a8f007]
contentservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Contentservice], [dc037ddc672111eb94ef0242c0a8f002]
imageservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Imageservice], [dc0047ac672111eba89e0242c0a8f003]
contentservice | [pid: 16|app: 0|req: 19/25] 95.91.253.112 () {40 vars in 740 bytes} [Thu Feb 4 21:14:21 2021] GET /contentservice/getcontent => generated 1479 bytes in 60 msecs (HTTP/2.0 200) 2 headers in 73 bytes (1 switches on core 0)
nginx | 95.91.253.112 - - [04/Feb/2021:21:14:21 +0000] "GET /contentservice/getcontent HTTP/2.0" 200 1479 "-" "insomnia/2020.5.2" "-"
userservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Userservice], [dbbe190e672111eb95d70242c0a8f007]
contentservice | skywalking [HeartbeatThread] [DEBUG] service heart beats, [Contentservice], [dc037ddc672111eb94ef0242c0a8f002]

Programmcode:

from gevent import monkey
monkey.patch_all()

config.flask_collect_http_params = True
config.logging_level = 'DEBUG'
config.disable_plugins = 'sw_tornado'
config.init(collector='X.X.X.X:11800', service='Contentservice')
agent.start()

import grpc.experimental.gevent as grpc_gevent # key point
grpc_gevent.init_gevent() # key point


Requirement or improvement

  • Please describe your requirements or improvement suggestions.

Metadata

Metadata

Assignees

Labels

pythonPython agent related

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions