Comments (17)
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.
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.
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.
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.
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.
Both seem fine to me
from spandex.
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.
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.
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.
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.
do you have any example how would it be done in phoenix?
from spandex.
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.
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.
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.
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.
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.
Resolved by #36
from spandex.
Related Issues (20)
- Pass Trace between process boundaries HOT 17
- Umbrella application and decorator configuration HOT 3
- Spandex processes dying HOT 5
- Spandex Decorators seem to be causing some problems during `mix release` HOT 16
- `distributed_context` takes a `Plug.Conn` rather than `headers()` HOT 6
- Can't make it work. HOT 8
- Log message does not correlate with the trace when trace_id and spand_id are included HOT 2
- Support Service Versions HOT 4
- How to redact information from traces? HOT 4
- Question: Which time unit to use in spans? HOT 1
- BUG: Spandex should encode trace_id/span_ids as strings in Logger metadata
- `version` should be supported as a top-level span attribute HOT 1
- Adapter Question HOT 1
- Compilation error when dynamically defined span names
- Tracing Broadway Processes HOT 1
- [Question] current_trace_id and current_span_id are returning nil HOT 2
- Help with async process? HOT 2
- Is Spandex still being maintained? HOT 9
- Equivalent to OpentelemetryProcessPropagator.Task?
- [Q] how to use spandex with absinthe telemetry events? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spandex.