jazzband / django-silk

Silky smooth profiling for Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

requests: Make more graphql friendly

tony opened this issue · comments

django silk: 5.0.1

Limitation

Consider a graphene view at /api/graphql-endpoint: Requests to individual queries will show up the same, even though the request object would be able to have a query name parsed out.

image

Potential solution

Two things are needed:

  1. An optional custom label field for Request model

    If there was a label / title to give requests for what to show in /silk/requests/ instead of request.path

  2. An optional callback in RequestModelFactory.construct_request_model() to customize the contents of models.Request.

    It will have accessed to to the django HttpRequest via self.request to fetch any necessary metadata and write a label