diff --git a/packages/instrumentation-cucumber/README.md b/packages/instrumentation-cucumber/README.md index 60933c2c10..f6808aca24 100644 --- a/packages/instrumentation-cucumber/README.md +++ b/packages/instrumentation-cucumber/README.md @@ -53,12 +53,11 @@ This package uses `@opentelemetry/semantic-conventions` version `1.22+`, which i Attributes collected: -| Attribute | Short Description | -| ---------------- | -------------------------------------------------------------------------------- | -| `code.filepath` | The source code file name that identifies the code unit as uniquely as possible. | -| `code.function` | The method or function name, or equivalent. | -| `code.lineno` | The line number in `code.filepath` best representing the operation. | -| `code.namespace` | The "namespace" within which `code.function` is defined. | +| Attribute | Short Description | +| -------------------- | -------------------------------------------------------------------------------- | +| `code.file.path` | The source code file name that identifies the code unit as uniquely as possible. | +| `code.function.name` | The method or function fully-qualified name without arguments. | +| `code.line.number` | The line number in `code.file.path` best representing the operation. | ## Useful links diff --git a/packages/instrumentation-cucumber/src/instrumentation.ts b/packages/instrumentation-cucumber/src/instrumentation.ts index 1c8e73de19..b78d270af5 100644 --- a/packages/instrumentation-cucumber/src/instrumentation.ts +++ b/packages/instrumentation-cucumber/src/instrumentation.ts @@ -22,10 +22,9 @@ import { isWrapped, } from '@opentelemetry/instrumentation'; import { - SEMATTRS_CODE_FILEPATH, - SEMATTRS_CODE_FUNCTION, - SEMATTRS_CODE_LINENO, - SEMATTRS_CODE_NAMESPACE, + ATTR_CODE_FILE_PATH, + ATTR_CODE_FUNCTION_NAME, + ATTR_CODE_LINE_NUMBER, } from '@opentelemetry/semantic-conventions'; import type * as cucumber from '@cucumber/cucumber'; @@ -182,10 +181,9 @@ export class CucumberInstrumentation extends InstrumentationBase { const spanProcessor = new SimpleSpanProcessor(memoryExporter); const provider = new NodeTracerProvider({ resource: resourceFromAttributes({ - [SEMRESATTRS_SERVICE_NAME]: 'CucumberInstrumentation', + [ATTR_SERVICE_NAME]: 'CucumberInstrumentation', }), spanProcessors: [spanProcessor], }); @@ -169,10 +168,9 @@ describe('CucumberInstrumentation', () => { assert(parent, 'Expected a parent span'); assert.deepEqual(parent.attributes, { - [SEMATTRS_CODE_FILEPATH]: path.join('test', 'current.feature'), - [SEMATTRS_CODE_LINENO]: 7, - [SEMATTRS_CODE_FUNCTION]: 'Button pushing', - [SEMATTRS_CODE_NAMESPACE]: 'Basic', + [ATTR_CODE_FILE_PATH]: path.join('test', 'current.feature'), + [ATTR_CODE_LINE_NUMBER]: 7, + [ATTR_CODE_FUNCTION_NAME]: 'Basic Button pushing', [AttributeNames.FEATURE_DESCRIPTION]: ' A very basic feature file with a single scenario', [AttributeNames.FEATURE_LANGUAGE]: 'en',