Giter VIP home page Giter VIP logo

Comments (6)

bnjjj avatar bnjjj commented on July 19, 2024

@grzn It's actually already possible using custom router metric but not really obvious neither well documented. To get the operation name you can have it using response_context selector and use the operation_name entry. That would result in something like this:

telemetry:
  instrumentation:
    instruments:
      router:
        http.server.request.body.size:
          attributes:
            graphql.operation.name:
              response_context: operation_name
        http.server.response.body.size:
          attributes:
            graphql.operation.name:
              response_context: operation_name

from router.

grzn avatar grzn commented on July 19, 2024

@bnjjj thanks, it works well for request body size, but not for response body size; after adding this, the metrics lo longer shows on he metrics response.

$ curl http://localhost:9091/metrics | grep http_server_res
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 69332  100 69332    0     0  53.4M      0 --:--:-- --:--:-- --:--:-- 66.1M

from router.

bnjjj avatar bnjjj commented on July 19, 2024

Thanks @grzn I'll try to reproduce. Could you tell me which version of the router are you using ?

from router.

bnjjj avatar bnjjj commented on July 19, 2024

I was able to reproduce @grzn. It's not related to the configuration but the implementation of the response body size metric itself. It's based on the value of content-length header but that header is not populated. I need to dig more in order to fix that issue I'll create a follow up issue and close this one.

from router.

bnjjj avatar bnjjj commented on July 19, 2024

#5319

from router.

grzn avatar grzn commented on July 19, 2024

cool, thanks @bnjjj

from router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.