-
Notifications
You must be signed in to change notification settings - Fork 491
Closed
Labels
area:exporterbugSomething isn't workingSomething isn't workingspec-complianceNot compliant to OpenTelemetry specsNot compliant to OpenTelemetry specs
Description
Per the spec:
boolean environment variables should accept "true" or "false", with case insensitive comparison.
Other values should cause a warnings.
Per the code:
inline bool GetOtlpDefaultIsSslEnable()
{
constexpr char kOtlpTracesIsSslEnableEnv[] = "OTEL_EXPORTER_OTLP_TRACES_SSL_ENABLE";
constexpr char kOtlpIsSslEnableEnv[] = "OTEL_EXPORTER_OTLP_SSL_ENABLE";
auto ssl_enable = opentelemetry::sdk::common::GetEnvironmentVariable(kOtlpTracesIsSslEnableEnv);
if (ssl_enable.empty())
{
ssl_enable = opentelemetry::sdk::common::GetEnvironmentVariable(kOtlpIsSslEnableEnv);
}
if (ssl_enable == "True" || ssl_enable == "TRUE" || ssl_enable == "true" || ssl_enable == "1")
{
return true;
}
return false;
}
Issues:
- the string comparison is not case insensitive, for example
TrUe
should betrue
- no warning is raised
Beside, this code has been copied and pasted all other the place, some cleanup is needed.
lalitb and owent
Metadata
Metadata
Assignees
Labels
area:exporterbugSomething isn't workingSomething isn't workingspec-complianceNot compliant to OpenTelemetry specsNot compliant to OpenTelemetry specs