Skip to content

Commit

Permalink
chore(examples/web): use exported strings for attributes (#2129)
Browse files Browse the repository at this point in the history
Use exported strings for Semantic Attributes

Refs: #2025
  • Loading branch information
maryliag authored Apr 24, 2024
1 parent 0d38081 commit 5f1910b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/web/examples/document-load/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
import { CompositePropagator, W3CTraceContextPropagator } from '@opentelemetry/core';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';

const provider = new WebTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-dl',
[SEMRESATTRS_SERVICE_NAME]: 'web-service-dl',
}),
});

Expand Down
4 changes: 2 additions & 2 deletions examples/web/examples/meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';

const providerWithZone = new WebTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-meta',
[SEMRESATTRS_SERVICE_NAME]: 'web-service-meta',
}),
});

Expand Down
4 changes: 2 additions & 2 deletions examples/web/examples/user-interaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { B3Propagator } from '@opentelemetry/propagator-b3';
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';

const providerWithZone = new WebTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'web-service-ui',
[SEMRESATTRS_SERVICE_NAME]: 'web-service-ui',
}),
});

Expand Down
2 changes: 1 addition & 1 deletion examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@opentelemetry/instrumentation-xml-http-request": "^0.39.1",
"@opentelemetry/propagator-b3": "^1.13.0",
"@opentelemetry/sdk-trace-web": "^1.13.0",
"@opentelemetry/semantic-conventions": "^1.13.0"
"@opentelemetry/semantic-conventions": "^1.23.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme"
}

0 comments on commit 5f1910b

Please sign in to comment.