Skip to content

Commit

Permalink
Clean up tracerProvider logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonWeber committed Jan 16, 2024
1 parent 392a8ce commit ad5ec30
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions experimental/packages/opentelemetry-sdk-node/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,11 @@ export class NodeSDK {
? NodeTracerProvider
: TracerProviderWithEnvExporters;

let tracerProvider;

// If the Provider is configured with Env Exporters, we need to check if the SDK had any manual configurations, else configure normally
if (
typeof Provider === typeof TracerProviderWithEnvExporters &&
this._configuration
) {
tracerProvider = new Provider({
...this._configuration,
resource: this._resource,
});
} else {
tracerProvider = new Provider({
...this._tracerProviderConfig?.tracerConfig,
resource: this._resource,
});
}
// If the Provider is configured with Env Exporters, we need to check if the SDK had any manual configurations and set them here
const tracerProvider = new Provider({
...this._configuration,
resource: this._resource,
});

this._tracerProvider = tracerProvider;

Expand Down

0 comments on commit ad5ec30

Please sign in to comment.