Skip to content

Commit

Permalink
refactor(opentelemetry-sdk-node): lower diagnostic level
Browse files Browse the repository at this point in the history
This commit lowers the diagnostic level to debug when
exporters are not explicitly provided and the default is used.

Fixes: open-telemetry#5304
  • Loading branch information
cjihrig committed Jan 23, 2025
1 parent c00f36e commit 56b4dd3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to experimental packages in this project will be documented
### :rocket: (Enhancement)

* feat(instrumentation): re-export initialize function from import-in-the-middle [#5123](https://github.com/open-telemetry/opentelemetry-js/pull/5123)
* refactor(opentelemetry-sdk-node): lower diagnostic level [#5360](https://github.com/open-telemetry/opentelemetry-js/pull/5360) @cjihrig

### :bug: (Bug Fix)

Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/opentelemetry-sdk-node/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function configureMetricProviderFromEnv(): MetricReader[] {
const enabledExporters = filterBlanksAndNulls(metricsExporterList.split(','));

if (enabledExporters.length === 0) {
diag.info('OTEL_METRICS_EXPORTER is empty. Using default otlp exporter.');
diag.debug('OTEL_METRICS_EXPORTER is empty. Using default otlp exporter.');
}

if (enabledExporters.includes('none')) {
Expand Down Expand Up @@ -449,7 +449,7 @@ export class NodeSDK {
const enabledExporters = filterBlanksAndNulls(logExportersList.split(','));

if (enabledExporters.length === 0) {
diag.info('OTEL_LOGS_EXPORTER is empty. Using default otlp exporter.');
diag.debug('OTEL_LOGS_EXPORTER is empty. Using default otlp exporter.');
enabledExporters.push('otlp');
}

Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/opentelemetry-sdk-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function getSpanProcessorsFromEnv(): SpanProcessor[] {
}

if (traceExportersList.length === 0) {
diag.warn('OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.');
diag.debug('OTEL_TRACES_EXPORTER is empty. Using default otlp exporter.');
traceExportersList = ['otlp'];
} else if (
traceExportersList.length > 1 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ describe('Node SDK', () => {
sdk.start();
assert.ok(!(metrics.getMeterProvider() instanceof MeterProvider));
assert.strictEqual(
stubLogger.args[1][0],
stubLogger.args[0][0],
'OTEL_METRICS_EXPORTER contains "none". Metric provider will not be initialized.'
);
await sdk.shutdown();
Expand Down

0 comments on commit 56b4dd3

Please sign in to comment.