@@ -30,26 +30,29 @@ namespace exporter
3030namespace otlp
3131{
3232
33- constexpr char kEnvOtlpEndpoint [] = " OTEL_EXPORTER_OTLP_ENDPOINT" ;
34- constexpr char kEnvOtlpInsecure [] = " OTEL_EXPORTER_OTLP_INSECURE" ;
35- constexpr char kEnvOtlpSslEnable [] = " OTEL_EXPORTER_OTLP_SSL_ENABLE" ;
36- constexpr char kEnvOtlpCertificate [] = " OTEL_EXPORTER_OTLP_CERTIFICATE" ;
37- constexpr char kEnvOtlpCertificateString [] = " OTEL_EXPORTER_OTLP_CERTIFICATE_STRING" ;
38- constexpr char kEnvOtlpClientKey [] = " OTEL_EXPORTER_OTLP_CLIENT_KEY" ;
39- constexpr char kEnvOtlpClientKeyString [] = " OTEL_EXPORTER_OTLP_CLIENT_KEY_STRING" ;
40- constexpr char kEnvOtlpClientCertificate [] = " OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE" ;
41- constexpr char kEnvOtlpClientCertificateString [] = " OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE_STRING" ;
42- constexpr char kEnvOtlpTimeout [] = " OTEL_EXPORTER_OTLP_TIMEOUT" ;
43- constexpr char kEnvOtlpHeaders [] = " OTEL_EXPORTER_OTLP_HEADERS" ;
44- constexpr char kEnvOtlpCompression [] = " OTEL_EXPORTER_OTLP_COMPRESSION" ;
45- constexpr char kEnvOtlpRetryMaxAttempts [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS" ;
46- constexpr char kEnvOtlpRetryInitialBackoff [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF" ;
47- constexpr char kEnvOtlpRetryMaxBackoff [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_BACKOFF" ;
48- constexpr char kEnvOtlpRetryBackoffMultiplier [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_BACKOFF_MULTIPLIER" ;
49- constexpr char kEnvOtlpMinTls [] = " OTEL_CPP_EXPORTER_OTLP_MIN_TLS" ;
50- constexpr char kEnvOtlpMaxTls [] = " OTEL_CPP_EXPORTER_OTLP_MAX_TLS" ;
51- constexpr char kEnvOtlpCipher [] = " OTEL_CPP_EXPORTER_OTLP_CIPHER" ;
52- constexpr char kEnvOtlpCipherSuite [] = " OTEL_CPP_EXPORTER_OTLP_CIPHER_SUITE" ;
33+ static constexpr char kEnvOtlpEndpoint [] = " OTEL_EXPORTER_OTLP_ENDPOINT" ;
34+ static constexpr char kEnvOtlpInsecure [] = " OTEL_EXPORTER_OTLP_INSECURE" ;
35+ static constexpr char kEnvOtlpSslEnable [] = " OTEL_EXPORTER_OTLP_SSL_ENABLE" ;
36+ static constexpr char kEnvOtlpCertificate [] = " OTEL_EXPORTER_OTLP_CERTIFICATE" ;
37+ static constexpr char kEnvOtlpCertificateString [] = " OTEL_EXPORTER_OTLP_CERTIFICATE_STRING" ;
38+ static constexpr char kEnvOtlpClientKey [] = " OTEL_EXPORTER_OTLP_CLIENT_KEY" ;
39+ static constexpr char kEnvOtlpClientKeyString [] = " OTEL_EXPORTER_OTLP_CLIENT_KEY_STRING" ;
40+ static constexpr char kEnvOtlpClientCertificate [] = " OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE" ;
41+ static constexpr char kEnvOtlpClientCertificateString [] =
42+ " OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE_STRING" ;
43+ static constexpr char kEnvOtlpTimeout [] = " OTEL_EXPORTER_OTLP_TIMEOUT" ;
44+ static constexpr char kEnvOtlpHeaders [] = " OTEL_EXPORTER_OTLP_HEADERS" ;
45+ static constexpr char kEnvOtlpCompression [] = " OTEL_EXPORTER_OTLP_COMPRESSION" ;
46+ static constexpr char kEnvOtlpRetryMaxAttempts [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS" ;
47+ static constexpr char kEnvOtlpRetryInitialBackoff [] =
48+ " OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF" ;
49+ static constexpr char kEnvOtlpRetryMaxBackoff [] = " OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_BACKOFF" ;
50+ static constexpr char kEnvOtlpRetryBackoffMultiplier [] =
51+ " OTEL_CPP_EXPORTER_OTLP_RETRY_BACKOFF_MULTIPLIER" ;
52+ static constexpr char kEnvOtlpMinTls [] = " OTEL_CPP_EXPORTER_OTLP_MIN_TLS" ;
53+ static constexpr char kEnvOtlpMaxTls [] = " OTEL_CPP_EXPORTER_OTLP_MAX_TLS" ;
54+ static constexpr char kEnvOtlpCipher [] = " OTEL_CPP_EXPORTER_OTLP_CIPHER" ;
55+ static constexpr char kEnvOtlpCipherSuite [] = " OTEL_CPP_EXPORTER_OTLP_CIPHER_SUITE" ;
5356
5457static bool GetBoolDualEnvVar (const char *signal_name, const char *generic_name, bool &value)
5558{
@@ -336,7 +339,7 @@ bool GetOtlpDefaultGrpcTracesIsInsecure()
336339
337340 /* The trace endpoint, when providing a scheme, takes precedence. */
338341
339- if (endpoint.substr (0 , 6 ) == " https:" )
342+ if (opentelemetry::nostd::string_view ( endpoint) .substr (0 , 6 ) == " https:" )
340343 {
341344 return false ;
342345 }
@@ -392,7 +395,7 @@ bool GetOtlpDefaultGrpcMetricsIsInsecure()
392395
393396 /* The metrics endpoint, when providing a scheme, takes precedence. */
394397
395- if (endpoint.substr (0 , 6 ) == " https:" )
398+ if (opentelemetry::nostd::string_view ( endpoint) .substr (0 , 6 ) == " https:" )
396399 {
397400 return false ;
398401 }
@@ -448,7 +451,7 @@ bool GetOtlpDefaultGrpcLogsIsInsecure()
448451
449452 /* The logs endpoint, when providing a scheme, takes precedence. */
450453
451- if (endpoint.substr (0 , 6 ) == " https:" )
454+ if (opentelemetry::nostd::string_view ( endpoint) .substr (0 , 6 ) == " https:" )
452455 {
453456 return false ;
454457 }
@@ -1301,7 +1304,7 @@ bool GetOtlpDefaultGrpcClientIsInsecure()
13011304{
13021305 std::string endpoint = GetOtlpDefaultGrpcClientEndpoint ();
13031306
1304- if (endpoint.substr (0 , 6 ) == " https:" )
1307+ if (opentelemetry::nostd::string_view ( endpoint) .substr (0 , 6 ) == " https:" )
13051308 {
13061309 return false ;
13071310 }
0 commit comments