-
Notifications
You must be signed in to change notification settings - Fork 206
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
Use current activity if there is one #1228
Conversation
This commit fixes a bug whereby `Activity.Current` should be used to set the TraceId if 1. it's not null 2. it's using W3C Id format 3. activity are not being ignored
This is needed for #1225 |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
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.
Overall it looks good to me. I left 1 minor thing to add a comment and another one (that's the more important) about setting the recorded flag on the already existing Activity
.
Jenkins also showed failing gRPC tests, I looked into that - I found the problem within WebRequestTransactionCreator.cs
, I opened a PR against your branch: russcam#1 - I think that'll fix the gRPC problem.
#1235 has made me think about whether we should create a new activity or not, based on there being an existing activity that meets the criteria, vs. always creating a new activity, but reusing the traceid and tracestate of the existing activity, if it meets criteria. I'm thinking about this from a user's usability perspective - I don't have a good handle on what a user might want to do with the current Activity inside of an APM transaction, and whether they might need to know if a new activity has been started or not. What are your thoughts, @gregkalapos? |
That's a good point. I feel the most important thing is that
If there is already an activity A related thing that comes to my mind: So, in sum: I think always creating an activity won't change a lot here, and it's be more consistent. Regardless of this, I'd keep the code from #1235 where we walk the |
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.
LGTM 👍
This commit always starts a new Activity, if we're not ignoring activities. If DistributedTracingData has been supplied, try to set the ParentId of the created activity using it.
I've just committed eb4f85b to always create and start a new Activity, if we're not ignoring them. This commit also tries to set the ParentId of the created Activity to the |
Would you mind taking this another look, @gregkalapos? I think it's good to go, but interested in your thoughts on the changes in eb4f85b |
This commit fixes a bug whereby
Activity.Current
should be usedto set the TraceId if