Skip to content
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

fix: net instrumentation - change span kind of connect to internal #394

Merged
merged 5 commits into from
Mar 24, 2021

Conversation

seemk
Copy link
Contributor

@seemk seemk commented Mar 23, 2021

Which problem is this PR solving?

From the spec:

  • CLIENT Indicates that the span describes a synchronous request to some remote service. This span is the parent of a remote SERVER span and waits for its response.

However there is no corresponding server span for connect. Thus I think the least spec violating span kind for connect should be INTERNAL.

Short description of the changes

Change span kind of connect from CLIENT to INTERNAL.

@seemk seemk requested a review from a team March 23, 2021 16:59
@@ -92,7 +92,7 @@ export class NetInstrumentation extends InstrumentationBase<Net> {
/* It might still be useful to pick up errors due to invalid connect arguments. */
private _startGenericSpan(socket: Socket) {
const span = this.tracer.startSpan('connect', {
kind: SpanKind.CLIENT,
kind: SpanKind.INTERNAL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpanKind.INTERNAL is the default so you could omit the second argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good point 🙂 Fixed it

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #394 (8855165) into main (21af6e7) will not change coverage.
The diff coverage is n/a.

❗ Current head 8855165 differs from pull request most recent head 7e8681c. Consider uploading reports for the commit 7e8681c to get more accurate results

@@           Coverage Diff           @@
##             main     #394   +/-   ##
=======================================
  Coverage   94.43%   94.43%           
=======================================
  Files          11       11           
  Lines         431      431           
  Branches       48       48           
=======================================
  Hits          407      407           
  Misses         24       24           

@vmarchaud vmarchaud merged commit 92656a3 into open-telemetry:main Mar 24, 2021
@dyladan dyladan added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants