-
Notifications
You must be signed in to change notification settings - Fork 197
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
feat: add service target fields support to http and grpc requests #1287
Merged
+23
−7
Merged
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
21bb1e5
feat: add service target fields support to http and grpc requests
kruskall e0928c4
Merge branch 'main' into feat/service-target-http
kruskall 25194f0
fix: update service target name to include default port for some prot…
kruskall dc3b973
test: make sure 'SetHTTPRequest' is setting the correct service targe…
kruskall 39b7b00
Merge branch 'main' into feat/service-target-http
kruskall c644584
fix: remove explicit http type now that the fallback mechanism is merged
kruskall b20d91c
Merge branch 'main' into feat/service-target-http
kruskall df30354
fix: readd explicit http service target type
kruskall 1a40227
fix: remove explicit type again
kruskall 6f0b1e4
test: mark spans as exit spans and update type on http test
kruskall b71201f
Merge branch 'main' into feat/service-target-http
kruskall bea474e
refactor: omit service target type for grpc
kruskall 8bddb28
test: disable service target field assertion for grpc test
kruskall 77a8519
Revert "test: disable service target field assertion for grpc test"
kruskall eafcc60
fix: omit service target fields on non-exit spans
kruskall bc60085
test: update tests for exit-span changes
kruskall 3637393
Merge branch 'main' into feat/service-target-http
kruskall 1fe6fc5
Revert "test: update tests for exit-span changes"
kruskall f5b75a5
test: remove service target fields assertions from non exit spans
kruskall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Same issue, test is failing because it's not an exit span. Should we update this in the issue to omit
service.target
for non-exit spans?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.
Ah, and we don't have a way to mark some gRPC spans as exit spans yet...
Yes, let's just update this PR to omit for non-exit spans.
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 span context doesn't know if the parent span is an exit span. I'm not sure how to proceed, should we add a field to the span context ? I'd prefer to avoid that as it feels like coupling different components
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 also don't think we add the exit flag as a field. Here's a couple of options that come to mind:
Span.End
to do something like this:Maybe like this:
span.exit
intoSpanContext.build()
inbuildModelSpan
:apm-agent-go/modelwriter.go
Line 156 in 99546a3
And
build()
would clear themodel.SpanContext.Service
field for non-exit spans.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.
Thank you for help! 🙇
Quick question before pushing more changes: do we have a way to mark grpc/http requests as exit spans ? The latest change is going to reduce coverage of this feature because the spans used in testing are not exit spans.
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.
Not at the moment. For gRPC, we always assume that the target service is instrumented and pass trace context. Thus it should not be considered an "exit" span. I think we should make this configurable. I opened an issue about doing this for
apmhttp
spans recently, and have just updated it to also takeapmgrpc
client spans into account: #1304There 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.
@kruskall sorry, I led you astray due to my own confusion around exit spans and trace-context propagation. We should be marking HTTP, gRPC, Elasticsearch, and some other spans as "exit spans" by default. See #1315
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.
No worries 😄
I think this PR grew in scope quite a lot, I've spli the fix in a separate PR: #1317