kolofordjango / kolo

See everything happening in your running Django app. All without leaving VSCode
https://kolo.app
486 stars 14 forks source link

Kolo doesn't seem to capture any information (No execution nodes captured) #78

Closed kwint closed 1 month ago

kwint commented 5 months ago

Not sure what I am doing wrong here

Installed kojo as a middleware, and it is clearly doing something.

image

Could it be because we use django-channels?

LilyFoote commented 5 months ago

Hey @kwint! Are you able to view the raw trace? If you right click one of these traces you should see a menu with an Open raw trace option. It would be useful to see the contents of that to narrow down the problem.

If you're able to share a minimal code sample that shows the bug, that would be amazing too.

kwint commented 5 months ago

Thanks for looking in to this @LilyFoote

{
  "command_line_args": [
    "manage.py",
    "runserver",
    "0.0.0.0:8888"
  ],
  "current_commit_sha": "463c2b03c79ffc6d0bb6b199fa26630f868fa432",
  "frames": {},
  "frames_of_interest": [],
  "main_thread_id": 5349,
  "meta": {
    "version": "2.17.0",
    "source": "kolo.middleware.KoloMiddleware",
    "use_frame_boundaries": true
  },
  "timestamp": 1706111972.2848043,
  "trace_id": "trc_01HMY35CXW7X43EB0FF2QGHRJJ"
}

This is the raw trace. All of them look the same.

tbh I have no clue where to start with making a minimal code sample, but i'll give it a shot

kwint commented 5 months ago

My db is listening to a non default port, but I doubt that is it?

kwint commented 5 months ago

Playing a little bit more around with gave me this captured "thing":

image

The log opens and shows me this json:

# HTTP GET /static/admin/css/widgets.css 200 [0.05, 127.0.0.1:41676]
{
  "msg": "\u001b[mHTTP %(method)s %(path)s %(status)s [%(time_taken).2f, %(client)s]\u001b[0m",
  "args": [
    {
      "path": "/static/admin/css/widgets.css",
      "status": 200,
      "method": "GET",
      "client": "127.0.0.1:41676",
      "time_taken": 0.04927849769592285,
      "size": 11921
    }
  ],
  "extra": null,
  "level": "INFO"
}
wilhelmklopp commented 5 months ago

@kwint 👋 thanks for reporting! Until we figure this issue out, you might have more luck with @kolo.enable or with kolo.enable(): https://docs.kolo.app/en/latest/kolo-enabled.html

@LilyFoote might this be something to do with async / asgi / some kind of different runserver setup that is required to use django channels?

ahmedyasserays commented 1 month ago

@LilyFoote I had the same issue but i managed to fixed it from the documentation https://docs.kolo.app/en/latest/tutorial.html#configuration we should put the middleware in the top of all other middlewares

LilyFoote commented 1 month ago

I think we have a solution then. @kwint feel free to re-open if it doesn't work for you.