Giter Club home page Giter Club logo

Comments (5)

willie avatar willie commented on August 10, 2024 1

I'll fork, because I need this functionality anyway, and offer a PR that you can accept if you want!

from otelchi.

willie avatar willie commented on August 10, 2024 1

I was thinking that I would add attributes in the form of serverName.paramName like app.q as the name. The honeycomb.io documentation suggests:

Consider putting manual instrumentation under app.. Use as many layers of hierarchy as makes sense: app.shopping_cart.subtotal and app.shopping_cart.items; app.user.email and app.user.id.

from otelchi.

riandyrn avatar riandyrn commented on August 10, 2024

Hello, @willie

Thanks for your interest to contribute in otelchi!

I would like confirm my understanding first regarding what you want to propose.

I'd like to add support for logging query values to this middleware

Do you mean query string parameters in the URL?

Like for example if we have https://example.com?q=test&page=1 then you want to log the q=test&page=1 in the span attribute? Is this correct?

from otelchi.

willie avatar willie commented on August 10, 2024

Yes, I'd add q : test as one kv pair, then page : 1 as another kv pair. It's a small addition, but helpful for annotating spans.

from otelchi.

riandyrn avatar riandyrn commented on August 10, 2024

I'll fork, because I need this functionality anyway, and offer a PR that you can accept if you want!

I think this is the best, @willie! You rock! 🚀

I'd add q : test as one kv pair, then page : 1 as another kv pair

Actually I'm still hesitant to put this feature into otelchi because it is an instrumentation library.

In the context of instrumentation library, I believe it is better to strictly follow specification that has been created by OpenTelemetry team to ensure compatibility with the rest of the ecosystem.

In semantic convention for HTTP server (you can read the spec here), the query parameters is only specified in http.target attribute.

If we decided to add extra attributes for example http.target.query.<param_name>, in the future we might clash with the official convention (e.g the OpenTelemetry team decided to use http.target.query for something else). So I believe this feature should be implemented on end user side rather than on instrumentation library like otelchi.

But this is my current opinion. I might change it in the future.

from otelchi.

Related Issues (12)

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.