Skip to content

Commit fb2fdd2

Browse files
[core] migrate away from deprecated constants in sdk-info.ts (open-telemetry#5593)
Co-authored-by: Trent Mick <trentm@gmail.com>
1 parent cf6dffe commit fb2fdd2

4 files changed

Lines changed: 49 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2
2727

2828
* test(sdk-metrics): fix multiple problematic assertRejects() calls [#5611](https://github.com/open-telemetry/opentelemetry-js/pull/5611) @cjihrig
2929
* refactor: replace assertRejects() with assert.rejects() [#5614](https://github.com/open-telemetry/opentelemetry-js/pull/5614) @cjihrig
30+
* refactor(core): migrate from deprecated semconv constants [#5575](https://github.com/open-telemetry/opentelemetry-js/pull/5575) @alumni55748
3031

3132
## 2.0.0
3233

packages/opentelemetry-core/src/platform/browser/sdk-info.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
import { VERSION } from '../../version';
1818
import {
19-
SEMRESATTRS_TELEMETRY_SDK_NAME,
20-
SEMRESATTRS_PROCESS_RUNTIME_NAME,
21-
SEMRESATTRS_TELEMETRY_SDK_LANGUAGE,
22-
TELEMETRYSDKLANGUAGEVALUES_WEBJS,
23-
SEMRESATTRS_TELEMETRY_SDK_VERSION,
19+
ATTR_TELEMETRY_SDK_NAME,
20+
ATTR_TELEMETRY_SDK_LANGUAGE,
21+
TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
22+
ATTR_TELEMETRY_SDK_VERSION,
2423
} from '@opentelemetry/semantic-conventions';
24+
import { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';
2525

2626
/** Constants describing the SDK in use */
2727
export const SDK_INFO = {
28-
[SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry',
29-
[SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser',
30-
[SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: TELEMETRYSDKLANGUAGEVALUES_WEBJS,
31-
[SEMRESATTRS_TELEMETRY_SDK_VERSION]: VERSION,
28+
[ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',
29+
[ATTR_PROCESS_RUNTIME_NAME]: 'browser',
30+
[ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
31+
[ATTR_TELEMETRY_SDK_VERSION]: VERSION,
3232
};

packages/opentelemetry-core/src/platform/node/sdk-info.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
import { VERSION } from '../../version';
1818
import {
19-
SEMRESATTRS_TELEMETRY_SDK_NAME,
20-
SEMRESATTRS_PROCESS_RUNTIME_NAME,
21-
SEMRESATTRS_TELEMETRY_SDK_LANGUAGE,
22-
TELEMETRYSDKLANGUAGEVALUES_NODEJS,
23-
SEMRESATTRS_TELEMETRY_SDK_VERSION,
19+
ATTR_TELEMETRY_SDK_NAME,
20+
ATTR_TELEMETRY_SDK_LANGUAGE,
21+
TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,
22+
ATTR_TELEMETRY_SDK_VERSION,
2423
} from '@opentelemetry/semantic-conventions';
24+
import { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';
2525

2626
/** Constants describing the SDK in use */
2727
export const SDK_INFO = {
28-
[SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry',
29-
[SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node',
30-
[SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: TELEMETRYSDKLANGUAGEVALUES_NODEJS,
31-
[SEMRESATTRS_TELEMETRY_SDK_VERSION]: VERSION,
28+
[ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',
29+
[ATTR_PROCESS_RUNTIME_NAME]: 'node',
30+
[ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,
31+
[ATTR_TELEMETRY_SDK_VERSION]: VERSION,
3232
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*
18+
* This file contains a copy of unstable semantic convention definitions
19+
* used by this package.
20+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
21+
*/
22+
23+
/**
24+
* The name of the runtime of this process.
25+
*
26+
* @example OpenJDK Runtime Environment
27+
*
28+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
29+
*/
30+
export const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name' as const;

0 commit comments

Comments
 (0)