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: early close of span with graphql execute #752

Merged
merged 1 commit into from
Dec 5, 2021

Conversation

samriley
Copy link
Contributor

Which problem is this PR solving?

Fixes #750

Short description of the changes

Await promise resolution before calling endSpan

@samriley samriley requested a review from a team November 22, 2021 15:07
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 22, 2021

CLA Signed

The committers are authorized under a signed CLA.

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

Looks good. Would be nice if you could add a test for this

@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #752 (f8adbe8) into main (53691e4) will decrease coverage by 1.91%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #752      +/-   ##
==========================================
- Coverage   96.87%   94.96%   -1.92%     
==========================================
  Files          11       22      +11     
  Lines         641     1629     +988     
  Branches      127      221      +94     
==========================================
+ Hits          621     1547     +926     
- Misses         20       82      +62     
Impacted Files Coverage Δ
...try-instrumentation-graphql/src/instrumentation.ts 91.61% <100.00%> (ø)
...metry-instrumentation-graphql/test/graphql.test.ts 100.00% <100.00%> (ø)
...nstrumentation-graphql/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
.../opentelemetry-instrumentation-graphql/src/enum.ts 100.00% <0.00%> (ø)
...ages/auto-instrumentations-node/test/utils.test.ts 96.87% <0.00%> (ø)
...entelemetry-instrumentation-graphql/test/schema.ts 55.84% <0.00%> (ø)
...opentelemetry-instrumentation-graphql/src/utils.ts 93.40% <0.00%> (ø)
...tapackages/auto-instrumentations-node/src/utils.ts 96.77% <0.00%> (ø)
... and 3 more

@samriley
Copy link
Contributor Author

samriley commented Dec 2, 2021

Cheers, I'll take a look tomorrow at getting a unit test written and also rebasing it with the latest main branch

@samriley
Copy link
Contributor Author

samriley commented Dec 3, 2021

I've fixed the failing tests - it was due to a change in the execution order changing. I've added a test for the span timings, let me know if there are any changes you'd like - eg duplicating the test in to the different cases eg when depth is set to 0.

@vmarchaud
Copy link
Member

@samriley could you rebase your PR please ? it should be fix the lint

@vmarchaud vmarchaud added the bug Something isn't working label Dec 5, 2021
@vmarchaud vmarchaud merged commit 4a3b410 into open-telemetry:main Dec 5, 2021
@dyladan dyladan mentioned this pull request Feb 28, 2022
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.

Premature closing of execute span in graphql instrumentation
4 participants