fix: allow disabling trace export
ci / verify (push) Canceled after 0s

This commit is contained in:
Codex Local
2026-08-26 10:51:33 +08:00
parent f3dc6deb2e
commit 8955b57ddc
2 changed files with 20 additions and 1 deletions
+9 -1
View File
@@ -269,7 +269,7 @@ func Load(serviceName string) (Config, error) {
AuthIssuerURL: stringEnv("AUTH_ISSUER_URL", "http://localhost:58180/realms/voice-local"),
AuthJWKSURL: stringEnv("AUTH_JWKS_URL", "http://localhost:58180/realms/voice-local/protocol/openid-connect/certs"),
AuthAudience: stringEnv("AUTH_AUDIENCE", "voice-platform-web"),
OTLPEndpoint: stringEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "localhost:54317"),
OTLPEndpoint: stringEnvAllowEmpty("OTEL_EXPORTER_OTLP_ENDPOINT", "localhost:54317"),
DependencyTimeout: dependencyTimeout,
ExternalProbeInterval: externalProbeInterval,
ShutdownTimeout: shutdownTimeout,
@@ -703,6 +703,14 @@ func stringEnv(key, fallback string) string {
return value
}
func stringEnvAllowEmpty(key, fallback string) string {
value, exists := os.LookupEnv(key)
if !exists {
return fallback
}
return strings.TrimSpace(value)
}
func intEnv(key string, fallback int) (int, error) {
value := strings.TrimSpace(os.Getenv(key))
if value == "" {