-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user attribution API #1954
Add user attribution API #1954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding set_tag
should be okay, but I don't think the implementation of this is quite right.
set_user
should not be a facet of the Trace API as its not a part of the trace specification. I think it would be more appropriate if this function were made a part of the AppSec module wrapping theTraceOperation#set_tag
behavior.set_tag
shouldn't set tags directly on the root span; not at this level anyways. "Root span" is is a concrete implementation we're trying to abstract away, andTraceOperation
is agnostic to how traces are serialized. I think it would be more appropriate ifTraceOperation
accumulated tags for the trace separate from any span, serialized them intoTraceSegment
on#flush!
, then let theTraceFormatter
apply tags as appropriate to the spans being flushed (e.g. root span or local root span).
9b4a3e7
to
48d12fa
Compare
As discussed, PR split in two parts: user attribution and trace-level tags, this PR being based on #1959. |
d8365d8
to
a23820e
Compare
c534781
to
6566bf9
Compare
Codecov Report
@@ Coverage Diff @@
## master #1954 +/- ##
========================================
Coverage 97.74% 97.74%
========================================
Files 1004 1007 +3
Lines 50738 50902 +164
========================================
+ Hits 49592 49754 +162
- Misses 1146 1148 +2
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a68843b
to
68a9053
Compare
d2b27d0
to
c2136b2
Compare
Huh, CI flakily failed again: JRuby was stuck for 40+min after success and 2.4 (this time) failed after success with:
Canceled and restarted. |
Changes addressed: TraceOperation#set_tag
has been implemented separately. set_user
is not on TraceOperation
anymore.
c2136b2
to
f12229e
Compare
User attribution enables the user to conveniently tag a trace as being tied to a specific user. Behind the scenes this leverages setting a tag at the trace-level.
f12229e
to
a05b16a
Compare
Duh, my Datadog PGP key expired yesterday /facepalms/ (actually they all expired, my other ones since March /double-facepalms/) |
Added docs in DataDog/documentation#13941 |
User attribution enables the user to conveniently tag a trace as being tied to a specific user.
Behind the scenes this leverages setting a tag at the trace-level. Since trace transport does not have a concept of trace, tags are set on the topmost span.
When partial flushing is involved, the topmost span will be sent upon last flush, therefore tags will only appear in the UI when that final segment is processed.