Skip to content

Commit 5f1910b

Browse files
authored
chore(examples/web): use exported strings for attributes (#2129)
Use exported strings for Semantic Attributes Refs: #2025
1 parent 0d38081 commit 5f1910b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/web/examples/document-load/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
99
import { CompositePropagator, W3CTraceContextPropagator } from '@opentelemetry/core';
1010
import { registerInstrumentations } from '@opentelemetry/instrumentation';
1111
import { Resource } from '@opentelemetry/resources';
12-
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
12+
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
1313

1414
const provider = new WebTracerProvider({
1515
resource: new Resource({
16-
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-dl',
16+
[SEMRESATTRS_SERVICE_NAME]: 'web-service-dl',
1717
}),
1818
});
1919

examples/web/examples/meta/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
66
import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web';
77
import { registerInstrumentations } from '@opentelemetry/instrumentation';
88
import { Resource } from '@opentelemetry/resources';
9-
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
9+
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
1010

1111
const providerWithZone = new WebTracerProvider({
1212
resource: new Resource({
13-
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-meta',
13+
[SEMRESATTRS_SERVICE_NAME]: 'web-service-meta',
1414
}),
1515
});
1616

examples/web/examples/user-interaction/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
77
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
88
import { registerInstrumentations } from '@opentelemetry/instrumentation';
99
import { Resource } from '@opentelemetry/resources';
10-
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
10+
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
1111

1212
const providerWithZone = new WebTracerProvider({
1313
resource: new Resource({
14-
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-ui',
14+
[SEMRESATTRS_SERVICE_NAME]: 'web-service-ui',
1515
}),
1616
});
1717

examples/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@opentelemetry/instrumentation-xml-http-request": "^0.39.1",
4747
"@opentelemetry/propagator-b3": "^1.13.0",
4848
"@opentelemetry/sdk-trace-web": "^1.13.0",
49-
"@opentelemetry/semantic-conventions": "^1.13.0"
49+
"@opentelemetry/semantic-conventions": "^1.23.0"
5050
},
5151
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme"
5252
}

0 commit comments

Comments
 (0)