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

feat: add requireParentSpan option to pg instrumentation #1211

Closed
wants to merge 2 commits into from
Closed

feat: add requireParentSpan option to pg instrumentation #1211

wants to merge 2 commits into from

Conversation

henrinormak
Copy link
Contributor

Which problem is this PR solving?

pg instrumentation currently lacks the option to require a parent span, which can produce quite a bit of noise, especially in situations where there are things like health-checks being done against DBs etc.

Short description of the changes

Adds a new option (keeping the default to false so that this change does not alter existing deployments) requireParentSpan to the config of pg instrumentation. If set to true, it does not create spans unless there is a parent span that it can attach to

@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Merging #1211 (6a971e0) into main (1c450f5) will decrease coverage by 0.34%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1211      +/-   ##
==========================================
- Coverage   96.08%   95.73%   -0.35%     
==========================================
  Files          14       18       +4     
  Lines         893     1173     +280     
  Branches      191      237      +46     
==========================================
+ Hits          858     1123     +265     
- Misses         35       50      +15     
Impacted Files Coverage Δ
...elemetry-instrumentation-pg/src/instrumentation.ts 90.47% <100.00%> (ø)
...node/opentelemetry-instrumentation-pg/src/utils.ts 97.93% <100.00%> (ø)
...try-instrumentation-pg/src/enums/AttributeNames.ts 100.00% <0.00%> (ø)
...tapackages/auto-instrumentations-node/src/utils.ts 98.07% <0.00%> (ø)

@dyladan
Copy link
Member

dyladan commented Sep 28, 2022

This is a possible duplicate of #1199 can you see if that solves your issue and help with that PR?

@henrinormak
Copy link
Contributor Author

@dyladan that's a good find, it is indeed similar enough. I'm not quite sure how I can help there though? I will add a comment to see if help is needed with anything. Closing this one.

@dyladan
Copy link
Member

dyladan commented Sep 28, 2022

The best way to help would be to review the PR

@henrinormak henrinormak deleted the pg-require-parent branch November 14, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants