Skip to content

Use updated semantic-conventions pkg exports with ATTR_ prefix in all packages #2377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tracked by #4572
JamieDanielson opened this issue Aug 7, 2024 · 3 comments
Assignees

Comments

@JamieDanielson
Copy link
Member

JamieDanielson commented Aug 7, 2024

Similar to open-telemetry/opentelemetry-js#4896 in core, but in contrib

This is part of Semantic Convention Update: Tracking Issue #4572.

This issue is for changing SEMRESATTRS_ and SEMATTRS_ prefixes to just ATTR_ for attributes. No new attributes should be added in this change.

Note: Import @opentelemetry/semantic-conventions for stable semantic conventions. Use a local semconv.ts file for unstable semantic conventions. There is a script in js-contrib to generate the local file.

@JamieDanielson JamieDanielson changed the title Use updated attributes with ATTR prefix in all packages Use updated stable attributes with ATTR prefix in all packages Nov 15, 2024
@trentm
Copy link
Contributor

trentm commented Nov 20, 2024

Need to sort out open-telemetry/opentelemetry-js#5182 first (how to handle unstable semconv attributes).

@trentm trentm changed the title Use updated stable attributes with ATTR prefix in all packages Use updated attributes with ATTR prefix in all packages May 9, 2025
@trentm trentm self-assigned this May 9, 2025
@trentm trentm removed the blocked label May 9, 2025
@trentm
Copy link
Contributor

trentm commented May 9, 2025

The set to work through:

% npm-ws-ls | while read pkg; do echo -n "$pkg: "; rg 'SEM(RES)?ATTRS_' $pkg | wc -l; done | sort -n -k2
...
detectors/node/opentelemetry-resource-detector-container:        2
metapackages/auto-instrumentations-node:        2
plugins/node/opentelemetry-instrumentation-bunyan:        2
plugins/node/opentelemetry-instrumentation-graphql:        2
plugins/node/opentelemetry-instrumentation-pino:        2
plugins/node/opentelemetry-instrumentation-router:        2
detectors/node/opentelemetry-resource-detector-instana:        6
plugins/node/opentelemetry-instrumentation-connect:        6
plugins/node/opentelemetry-instrumentation-hapi:        6
plugins/node/opentelemetry-instrumentation-nestjs-core:        6
plugins/node/opentelemetry-instrumentation-restify:        7
plugins/node/opentelemetry-instrumentation-express:       10
plugins/node/opentelemetry-instrumentation-fastify:       12
plugins/node/opentelemetry-instrumentation-koa:       12
plugins/web/opentelemetry-instrumentation-document-load:       12
detectors/node/opentelemetry-resource-detector-gcp:       18
plugins/node/instrumentation-cucumber:       18
plugins/node/opentelemetry-instrumentation-knex:       18
plugins/node/opentelemetry-instrumentation-aws-lambda:       19
plugins/node/opentelemetry-instrumentation-memcached:       19
plugins/node/opentelemetry-instrumentation-redis:       21
detectors/node/opentelemetry-resource-detector-alibaba-cloud:       24
plugins/node/opentelemetry-instrumentation-cassandra:       27
plugins/node/instrumentation-tedious:       30
plugins/node/opentelemetry-instrumentation-mysql:       30
plugins/node/instrumentation-socket.io:       32
plugins/node/opentelemetry-instrumentation-mysql2:       32
plugins/node/opentelemetry-instrumentation-net:       33
plugins/node/opentelemetry-instrumentation-mongodb:       42
plugins/node/opentelemetry-instrumentation-ioredis:       49
plugins/node/opentelemetry-instrumentation-redis-4:       53
packages/opentelemetry-test-utils:       64
plugins/node/instrumentation-mongoose:       68
plugins/node/opentelemetry-instrumentation-pg:       89
detectors/node/opentelemetry-resource-detector-azure:       94
plugins/node/opentelemetry-instrumentation-aws-sdk:      165
plugins/node/instrumentation-amqplib:      315

Plus this old practice in instr-undici:

plugins/node/instrumentation-undici/src/enums/SemanticAttributes.ts
17:// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2
18:export const SemanticAttributes = {

Plus some hits like these:

detectors/node/opentelemetry-resource-detector-gcp/src/detectors/GcpDetector.ts:  CLOUDPROVIDERVALUES_GCP,
detectors/node/opentelemetry-resource-detector-alibaba-cloud/test/detectors/AlibabaCloudEcsDetector.test.ts:import { CLOUDPROVIDERVALUES_ALIBABA_CLOUD } from '@opentelemetry/semantic-conventions';
plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts:  DBSYSTEMVALUES_REDIS,
plugins/node/opentelemetry-instrumentation-ioredis/test/ioredis.test.ts:  DBSYSTEMVALUES_REDIS,
plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/dynamodb.ts:  DBSYSTEMVALUES_DYNAMODB,
...

@trentm trentm changed the title Use updated attributes with ATTR prefix in all packages Use updated semantic-conventions pkg exports with ATTR_ prefix in all packages May 9, 2025
trentm added a commit to trentm/opentelemetry-js-contrib that referenced this issue May 9, 2025
@trentm
Copy link
Contributor

trentm commented May 9, 2025

plugins/node/instrumentation-amqplib

Cannot update because it uses old exports (a) that don't have ATTR_ equivalents (e.g. SEMATTRS_MESSAGING_DESTINATION moved to ATTR_MESSAGING_DESTINATION_NAME, diff value) or (b) subtley changed value (SEMATTRS_MESSAGING_MESSAGE_ID messaging.message_id -> ATTR_MESSAGING_MESSAGE_ID messaging.message.id).

  • Option 1: don't update away from deprecated exports until do messaging semconv migration and 6mo later drop the old
  • Option 2: update subset of exports that do have ATTR_ equivalents; otherwise like Option 1
  • Option 3: update exports that do have ATTR_ equivs, change deprecated ones to be a local src/old-semconv.ts copy. Also do messaging semconv migration. This is the moral equiv of the src/semconv.ts process, but it is more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants