Skip to content

Commit 2eacf84

Browse files
committed
added support for rooted and unrooted forms of modules in span extractor
1 parent f9fc3ec commit 2eacf84

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/services/languages/python/spanExtractor.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,16 @@ export class PythonSpanExtractor implements ISpanExtractor {
7878

7979
const instrumentationLibrary = tracerName === '__name__'
8080
? (mainDeclared ? '__main__' : await this.extractNameTypeTrace(tracerDefinition.document.fileName))
81-
: tracerName
82-
81+
: tracerName;
82+
//Add the unrooted form
83+
if (instrumentationLibrary.includes(".")){
84+
let unrootedForm = instrumentationLibrary.split(".").slice(1).join(".");
85+
results.push(new SpanInfo(
86+
unrootedForm + '$_$' + spanName,
87+
spanName,
88+
token.range,
89+
document.uri));
90+
}
8391
results.push(new SpanInfo(
8492
instrumentationLibrary + '$_$' + spanName,
8593
spanName,

0 commit comments

Comments
 (0)