Skip to content

Commit

Permalink
refactor(examples/otlp-exporter-node): use new exported string consta…
Browse files Browse the repository at this point in the history
…nts for semconv (open-telemetry#4762)

* refactor(examples/otlp-exporter-node): use new exported string constants for semconv

* added changelog entry

---------

Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
2 people authored and Zirak committed Sep 14, 2024
1 parent c32006c commit c637ee5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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
* refactor(examples): use new exported string constants for semconv in examples/opentracing-shim-semconv [#4761](https://github.com/open-telemetry/opentelemetry-js/pull/4761) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/otlp-exporter-node [#4762](https://github.com/open-telemetry/opentelemetry-js/pull/4762) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/opentracing-shim [#4761](https://github.com/open-telemetry/opentelemetry-js/pull/4761) @Zen-cronic

### :house: (Internal)

Expand Down
4 changes: 2 additions & 2 deletions examples/otlp-exporter-node/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {
} = require('@opentelemetry/sdk-metrics');
const { Resource } = require('@opentelemetry/resources');
const {
SemanticResourceAttributes,
SEMRESATTRS_SERVICE_NAME,
} = require('@opentelemetry/semantic-conventions');

// Optional and only needed to see the internal diagnostic logging (during development)
Expand All @@ -36,7 +36,7 @@ const expHistogramView = new View({
// Create an instance of the metric provider
const meterProvider = new MeterProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'basic-metric-service',
[SEMRESATTRS_SERVICE_NAME]: 'basic-metric-service',
}),
views: [expHistogramView],
});
Expand Down
4 changes: 2 additions & 2 deletions examples/otlp-exporter-node/tracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { BasicTracerProvider, ConsoleSpanExporter, SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
const {
diag,
trace,
Expand All @@ -24,7 +24,7 @@ const exporter = new OTLPTraceExporter({

const provider = new BasicTracerProvider({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'basic-service',
[SEMRESATTRS_SERVICE_NAME]: 'basic-service',
}),
});
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
Expand Down

0 comments on commit c637ee5

Please sign in to comment.