-
Notifications
You must be signed in to change notification settings - Fork 40
feat: add requireParentSpan to typeorm instrumentation #270
Conversation
import { TypeormInstrumentationConfig } from '../types'; | ||
|
||
export function shouldSkipInstrumentation(config: TypeormInstrumentationConfig) { | ||
return config.requireParentSpan === true && trace.getSpan(context.active()) === undefined; |
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.
return config.requireParentSpan && trace.getSpan(context.active()) === undefined;
should work, there is no need for the === true
check
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.
Add tests to cover this new behavior.
see
opentelemetry-ext-js/packages/instrumentation-node-cache/test/node-cache.spec.ts
Line 174 in 3be217b
describe('requireParentSpan', () => { |
@mottibec thanks, build & test are failing locally though also on ci e.g: https://github.com/aspecto-io/opentelemetry-ext-js/actions/runs/8495994068/job/23272882049 i suspect that's due to lockfiles being in gitignore and some bumped ^ packages have mismatching types. |
It looks like the daily tests haven't been running for a while, i'm not sure what the issue is there. Anyway, I approved your test runs, but it fails on some module node supported version. This is probably not related to your change. To be honest, no one is actively maintaining this repository. I'm not sure how to help with that, but if you are able to fix it, it would be amazing. Otherwise, it would probably be left hanging there. |
Thanks, i did changes that should fix build and tests, some of which might not be in the scope of this PR (e.g bumping some deps) |
chore: pkg lock refactor: move tests around refactor: move nested tests around Update yarn.lock fix: properly terminate instrumentations temrinal intrumentation properly Update EntityManager.spec.ts Update QueryBuilder.spec.ts proper instrumentation registration Create QueryBuilder.spec.ts Update Repository.spec.ts
fix: make typeorm tests concurrency safe
adds requireParentSpan to typeorm instrumentation