Skip to content

Commit

Permalink
refactor(examples/http): use new exported string constants for semconv (
Browse files Browse the repository at this point in the history
#4750)

* refactor(examples/http): use new exported string constants for semconv

* added changelog entry

* refactor(examples/http): actually use new exported string constants for semconv
  • Loading branch information
Zen-cronic authored Jun 4, 2024
1 parent 95edbd9 commit 20074d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :books: (Refine Doc)

* refactor(examples): use new exported string constants for semconv in examples/http [#4750](https://github.com/open-telemetry/opentelemetry-js/pull/4750) @Zen-cronic

### :house: (Internal)

## 1.24.1
Expand Down
4 changes: 2 additions & 2 deletions examples/http/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const opentelemetry = require('@opentelemetry/api');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');
Expand All @@ -15,7 +15,7 @@ const EXPORTER = process.env.EXPORTER || '';
module.exports = (serviceName) => {
const provider = new NodeTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: serviceName,
[SEMRESATTRS_SERVICE_NAME]: serviceName,
}),
});

Expand Down

0 comments on commit 20074d8

Please sign in to comment.