Skip to content
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

fix deprecated semantic-conventions #5162

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions content/en/docs/languages/js/instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ import {
} from '@opentelemetry/sdk-metrics';
import { Resource } from '@opentelemetry/resources';
import {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} from '@opentelemetry/semantic-conventions';

const sdk = new NodeSDK({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'yourServiceName',
[SEMRESATTRS_SERVICE_VERSION]: '1.0',
[ATTR_SERVICE_NAME]: 'yourServiceName',
[ATTR_SERVICE_VERSION]: '1.0',
}),
traceExporter: new ConsoleSpanExporter(),
metricReader: new PeriodicExportingMetricReader({
Expand All @@ -253,14 +253,14 @@ const {
} = require('@opentelemetry/sdk-metrics');
const { Resource } = require('@opentelemetry/resources');
const {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} = require('@opentelemetry/semantic-conventions');

const sdk = new NodeSDK({
resource: new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'dice-server',
[SEMRESATTRS_SERVICE_VERSION]: '0.1.0',
[ATTR_SERVICE_NAME]: 'dice-server',
[ATTR_SERVICE_VERSION]: '0.1.0',
}),
traceExporter: new ConsoleSpanExporter(),
metricReader: new PeriodicExportingMetricReader({
Expand Down Expand Up @@ -352,8 +352,8 @@ SDK initialization code in it:
```ts
import { Resource } from '@opentelemetry/resources';
import {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} from '@opentelemetry/semantic-conventions';
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import {
Expand All @@ -363,8 +363,8 @@ import {

const resource = Resource.default().merge(
new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'service-name-here',
[SEMRESATTRS_SERVICE_VERSION]: '0.1.0',
[ATTR_SERVICE_NAME]: 'service-name-here',
[ATTR_SERVICE_VERSION]: '0.1.0',
}),
);

Expand All @@ -384,8 +384,8 @@ provider.register();
const opentelemetry = require('@opentelemetry/api');
const { Resource } = require('@opentelemetry/resources');
const {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} = require('@opentelemetry/semantic-conventions');
const { WebTracerProvider } = require('@opentelemetry/sdk-trace-web');
const {
Expand All @@ -395,8 +395,8 @@ const {

const resource = Resource.default().merge(
new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'service-name-here',
[SEMRESATTRS_SERVICE_VERSION]: '0.1.0',
[ATTR_SERVICE_NAME]: 'service-name-here',
[ATTR_SERVICE_VERSION]: '0.1.0',
}),
);

Expand Down Expand Up @@ -1259,14 +1259,14 @@ import {
} from '@opentelemetry/sdk-metrics';
import { Resource } from '@opentelemetry/resources';
import {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} from '@opentelemetry/semantic-conventions';

const resource = Resource.default().merge(
new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'dice-server',
[SEMRESATTRS_SERVICE_VERSION]: '0.1.0',
[ATTR_SERVICE_NAME]: 'dice-server',
[ATTR_SERVICE_VERSION]: '0.1.0',
}),
);

Expand Down Expand Up @@ -1296,14 +1296,14 @@ const {
} = require('@opentelemetry/sdk-metrics');
const { Resource } = require('@opentelemetry/resources');
const {
SEMRESATTRS_SERVICE_NAME,
SEMRESATTRS_SERVICE_VERSION,
ATTR_SERVICE_NAME,
ATTR_SERVICE_VERSION,
} = require('@opentelemetry/semantic-conventions');

const resource = Resource.default().merge(
new Resource({
[SEMRESATTRS_SERVICE_NAME]: 'service-name-here',
[SEMRESATTRS_SERVICE_VERSION]: '0.1.0',
[ATTR_SERVICE_NAME]: 'service-name-here',
[ATTR_SERVICE_VERSION]: '0.1.0',
}),
);

Expand Down