-
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
Auto-infer destination.service.resource and adapt public API #1520
Conversation
❕ Build Aborted
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
@@ -125,7 +125,8 @@ public interface IExecutionSegment | |||
/// </param> | |||
/// <param name="subType">The subtype of the span.</param> | |||
/// <param name="action">The action of the span.</param> | |||
void CaptureSpan(string name, string type, Action<ISpan> capturedAction, string subType = null, string action = null); | |||
/// <param name="isExitSpan">Indicates if this span is an exit span.</param> | |||
void CaptureSpan(string name, string type, Action<ISpan> capturedAction, string subType = null, string action = null, bool isExitSpan = false); |
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.
These are technically breaking changes to a public API, however this is probably the simplest way to implement exit spans. I can't think of a cleaner alternative
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.
Good point. Yeah, I also think this is the best option we have.
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.
The changes LGTM. A couple of questions:
-
Should a property be included on
ISpan
to indicate whether it is an exit span? -
It looks like exit span can be used in places where
InstrumentationFlag
is currently used to suppress child spans, such as in HttpDiagnosticListenerImplBaseapm-agent-dotnet/src/Elastic.Apm/DiagnosticListeners/HttpDiagnosticListenerImplBase.cs
Lines 139 to 146 in 64c27a8
// if the current span is an exit span, don't create a span for the current request // but still propagate trace context if (currentSpan.InstrumentationFlag == InstrumentationFlag.Azure || currentSpan.InstrumentationFlag == InstrumentationFlag.Elasticsearch) { PropagateTraceContext(request, transaction, currentSpan); return; } Should this be part of this PR?
- Introduces the concept of exit spans - Calculate Span.Context.Destination.Service.Resource only for exit spans based on the spec - Adapt all instrumentation to set the isExitSpan flag - Remove usage of the obsolete fields Destination.Service.Name and Destination.Service.Type
|
Merging this in - there are some failing tests with |
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
/// <summary> | ||
/// Indicates that this span is an exit span. | ||
/// </summary> | ||
public bool IsExitSpan { get; } |
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.
I think the public
modifier is unintentional here (will be public by default)?
Solves #1330
Destination.Service.Name
andDestination.Service.Type
- these fields were never used in APM Server and we should remove those long term according to [META 448] Auto-infer destination.service.resource and adapt public API #1330Destination.Service.Resource
for exit spans.Destination.Service.Resource
for exit spans. According to the spec this should only happen for exit spans which was not the case prior to this PRStartSpan
andCaptureSpan
APIs to also start exit spans and adapts the usage of it in instrumentation logic.