Giter VIP home page Giter VIP logo

Comments (17)

zachdaniel avatar zachdaniel commented on August 24, 2024

I think we should make those ids not datadog specific, as this is meant to be platform agnostic (even though there is only one adapter at the moment), so perhaps just x-parent-trace-id or something along those lines.

from spandex.

driv3r avatar driv3r commented on August 24, 2024

I would go for adapter.headers then each of adapters can implement own headers or add them in addition to agnostic ones - also I would suggest to check what's the convention for general use case

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

hmmm...perhaps having adapters provide plugs instead of adapter.headers? I hesitate to add web concepts to the trace adapter interface. We could just change the existing plug to be datadog specific, and then add the logic in there.

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

so instead of Spandex.Plug.AddContext it would be Spandex.Datadog.Plug.AddContext and then it can do w/e it wants really.

from spandex.

asummers avatar asummers commented on August 24, 2024

Would we want to namespace the plugs together or the Datadog specific stuff together? I am leaning towards the latter but could see an argument for Spandex.Plugs.Datadog.*

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

Both seem fine to me

from spandex.

driv3r avatar driv3r commented on August 24, 2024

otherwise to easier keep the plugs agnostic, we could just store the header names as configuration or plug option values, this could be actually compiled in-line (as you definitely don't switch between such systems on the fly). As far as I read the paper on Dapper from google and saw implementations based on it, most systems have both trace and span ids, those could be named differently, but I assume that in the end you need to have both in order to proceed with general trace.

wdys?

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

Hmm...

Yeah that is probably best. As a rule, we never want to compile something that might be configured by an environment variable. One should never say:

@module_attr Confex.get(:foo, :bar)

This stops one from being able to configure things via the environment (a problem especially when using deployments).

from spandex.

driv3r avatar driv3r commented on August 24, 2024

if we are on it, doesn't it make more sense to actually replace the EndTrace plug with a plug before send callback?

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

The main reason was because the trace itself might not necessarily be done at that point. For instance, if we wanted to consider the time that it takes to render the response and clean up after the request, then register_before_send is not sufficient.

from spandex.

driv3r avatar driv3r commented on August 24, 2024

do you have any example how would it be done in phoenix?

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

Do you mean an example of the plugs in a phoenix endpoint? Or how it could be simulated with a register_before_send? I haven't set up an example application, and our usage is in a closed source application. I could set one up if need be.

from spandex.

driv3r avatar driv3r commented on August 24, 2024

I know how I can do it with before send, I'm looking more for plugs in phoenix endpoint, or in plain Plug Router. Personally I use small wrapper around Plug Router, that's why I'm asking

from spandex.

driv3r avatar driv3r commented on August 24, 2024

it's good that we didn't added it just yet, based on DataDog/dd-trace-rb#151 the headers have been aligned to x-datadog-trace-id and x-datadog-parent-id

from spandex.

aspett avatar aspett commented on August 24, 2024

Was there a conclusion on how you wished to implement this? We would like to use distributed tracing across some services - I may be able to pick this up if there's a consensus on the way go about it.

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

I think the best way is to modify the StartTrace plug to accept a list of headers to look in for a trace id. If it finds one of those, it uses Spandex.continue_trace instead of starting a new trace. Feel free to take a stab at it!

from spandex.

zachdaniel avatar zachdaniel commented on August 24, 2024

Resolved by #36

from spandex.

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.