Skip to content

clean up src/semconv.ts usage in instr-oracledb #3083

@trentm

Description

@trentm

Typically we are using src/semconv.ts in packages to hold copies of unstable semconv constants from the @opentelemetry/semantic-conventions/incubating entry-point, per docs at https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
The https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/scripts/gen-semconv-ts.js tool exists to generate/update this file (with some limitations/quirks).

The src/semconv.ts in instr-oracledb isn't following this pattern. It is using export constant names with values that differ from those in @opentelemetry/semantic-conventions/incubating.

[packages/instrumentation-oracledb]$ rg export src/semconv.ts
24:export const ATTR_DB_SYSTEM = 'db.system.name';
40:export const ATTR_DB_NAMESPACE = 'db.namespace';
56:export const ATTR_DB_OPERATION_NAME = 'db.operation.name';
79:export const ATTR_DB_STATEMENT = 'db.query.text';
95:export const ATTR_DB_OPERATION_PARAMETER = 'db.operation.parameter';
101:export const ATTR_DB_USER = 'db.user';

Specifically, the following three export names have diff values in the semconv package:

[~/src/opentelemetry-js/semantic-conventions]$ rg 'export const ATTR_DB_(SYSTEM|STATEMENT|OPERATION_PARAMETER)' src/experimental_attributes.ts
3976:export const ATTR_DB_OPERATION_PARAMETER = (key: string) => `db.operation.parameter.${key}`;
4048:export const ATTR_DB_STATEMENT = 'db.statement' as const;
4057:export const ATTR_DB_SYSTEM = 'db.system' as const;

My guess, for DB_STATEMENT and DB_SYSTEM is that this was an attempt to introduce instr-oracledb using the newer stable semconv, but for some reason using the older constant names. I think we'll just need to update to use the stable constant names -- i.e. an easy change.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions