-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracer provider always attempts to read exporter from env #3449
Comments
Might be related: #3422 |
Should I just add some logic that checks if a user has an exporter defined, then don't run |
I'm not sure about the feasible way to achieve this without breaking, as the Anyway, if you have any idea about this, please go ahead! |
This pr changed _buildExporterFromEnv() {
const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER;
if (exporterName === 'none' || exporterName === '')
return;
const exporter = this._getSpanExporter(exporterName);
if (!exporter) {
api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`);
}
return exporter;
} And then I can update the This solution would just mean that a user will get the default otlp exporter if they set |
Hello @svetlanabrennan, Please see the packages:
|
This issue should be closed as it's released in newest version? 🤔 |
@AkselAllas I think it is not, I took the latest packages and issue still exists. |
Issue is still present. Can confirm |
I've noticed this is the same as #3422 |
What happened?
Steps to Reproduce
seems that
BasicTracerProvider
constructor always attempts to_buildExporterFromEnv
here.This get's executed even when the user supplies his own exporter in code, and there is no need to search the env, for example, when using NodeSDK
traceExporter
config option.The
_buildExporterFromEnv
function will outputerror
to it's diag logger, which is falsy as the workflow is valid.Expected Result
No errors in diag channel when user initialize the sdk/tracer provider in a valid, documented pattern.
Actual Result
There is an error message in diag:
Additional Details
I think that
BasicTracerProvider
should only attempt to initialize components from env when the user did not set them.OpenTelemetry Setup Code
package.json
Relevant log output
The text was updated successfully, but these errors were encountered: