Skip to content

Commit eb72080

Browse files
committed
Write full method fqn for code.function.name attribute in accordance with OTel semantic conventions
1 parent f291d86 commit eb72080

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/backend/generation.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { faker } from '@faker-js/faker';
22
import { Attributes } from '@opentelemetry/api';
3-
import {
4-
ATTR_CODE_FUNCTION_NAME,
5-
ATTR_SERVICE_NAME,
6-
SEMATTRS_CODE_NAMESPACE,
7-
} from '@opentelemetry/semantic-conventions';
3+
import { ATTR_CODE_FUNCTION_NAME, ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
84
import { strict as assert } from 'assert';
95
import { NameGenerator } from './naming';
106
import { FakeSpan, FakeTrace } from './tracing';
@@ -510,8 +506,7 @@ export function generateFakeTrace(apps: Array<FakeApp>, params: TraceGenerationP
510506
};
511507
}
512508
spanAttrs[ATTR_SERVICE_NAME] = startingApp.name;
513-
spanAttrs[SEMATTRS_CODE_NAMESPACE] = entryPointFqn;
514-
spanAttrs[ATTR_CODE_FUNCTION_NAME] = entryMethod;
509+
spanAttrs[ATTR_CODE_FUNCTION_NAME] = entryPointFqn + '.' + entryMethod;
515510

516511
const entrySpan: FakeSpan = {
517512
name: `${entryPointFqn}.${entryMethod}`,
@@ -637,8 +632,7 @@ export function generateFakeTrace(apps: Array<FakeApp>, params: TraceGenerationP
637632
}
638633
const classFqn = getClassFqn(nextClass);
639634
spanAttrs[ATTR_SERVICE_NAME] = nextClass.parentAppName;
640-
spanAttrs[SEMATTRS_CODE_NAMESPACE] = classFqn;
641-
spanAttrs[ATTR_CODE_FUNCTION_NAME] = nextMethod;
635+
spanAttrs[ATTR_CODE_FUNCTION_NAME] = classFqn + '.' + nextMethod;
642636
const nextSpan: FakeSpan = {
643637
name: `${classFqn}.${nextMethod}`,
644638
relativeStartTime: timePassed,

0 commit comments

Comments
 (0)