8000 refactor(core): Use (tree-shakeable) string constants for semconv (#4… · open-telemetry/opentelemetry-js@ecc88a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit ecc88a3

Browse files
refactor(core): Use (tree-shakeable) string constants for semconv (#4739)
* refactor(core): Use exported strings for semconv * Update changelog
1 parent 634277f commit ecc88a3

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
1414

1515
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
1616
* feat(context-zone*): support zone.js 0.12.x [#4376](https://github.com/open-telemetry/opentelemetry-js/pull/4736) @maldago
17+
* refactor(core): Use tree-shakeable string constants for semconv [#4739](https://github.com/open-telemetry/opentelemetry-js/pull/4739) @JohannesHuster
1718

1819
### :bug: (Bug Fix)
1920

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

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

1717
import { VERSION } from '../../version';
1818
import {
19-
TelemetrySdkLanguageValues,
20-
SemanticResourceAttributes,
19+
SEMRESATTRS_TELEMETRY_SDK_NAME,
20+
SEMRESATTRS_PROCESS_RUNTIME_NAME,
21+
SEMRESATTRS_TELEMETRY_SDK_LANGUAGE,
22+
TELEMETRYSDKLANGUAGEVALUES_WEBJS,
23+
SEMRESATTRS_TELEMETRY_SDK_VERSION,
2124
} from '@opentelemetry/semantic-conventions';
2225

2326
/** Constants describing the SDK in use */
2427
export const SDK_INFO = {
25-
[SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry',
26-
[SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'browser',
27-
[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:
28-
TelemetrySdkLanguageValues.WEBJS,
29-
[SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: VERSION,
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,
3032
};

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

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

1717
import { VERSION } from '../../version';
1818
import {
19-
TelemetrySdkLanguageValues,
20-
SemanticResourceAttributes,
19+
SEMRESATTRS_TELEMETRY_SDK_NAME,
20+
SEMRESATTRS_PROCESS_RUNTIME_NAME,
21+
SEMRESATTRS_TELEMETRY_SDK_LANGUAGE,
22+
TELEMETRYSDKLANGUAGEVALUES_NODEJS,
23+
SEMRESATTRS_TELEMETRY_SDK_VERSION,
2124
} from '@opentelemetry/semantic-conventions';
2225

2326
/** Constants describing the SDK in use */
2427
export const SDK_INFO = {
25-
[SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry',
26-
[SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node',
27-
[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:
28-
TelemetrySdkLanguageValues.NODEJS,
29-
[SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: VERSION,
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,
3032
};

0 commit comments

Comments
 (0)
0