feat(infra): add OTel auto-instrumentations across all services
Some checks failed
CI / quality-proto (push) Failing after 2s
CI / deploy (push) Has been skipped
CI / quality-ts (push) Failing after 1m11s
CI / quality-go (push) Failing after 5s

NestJS 6 services use getNodeAutoInstrumentations().

Python 2 services use FastAPIInstrumentor. Go 2 services use otelgin.
This commit is contained in:
SpecialX
2026-07-09 13:25:46 +08:00
parent 1f901c5b20
commit d8dab70406
28 changed files with 1653 additions and 224 deletions

View File

@@ -4,19 +4,21 @@ import "os"
// Config 持有 push-gateway 运行时配置
type Config struct {
Port string
JWTSecret string
DevMode bool
RedisURL string
Port string
JWTSecret string
DevMode bool
RedisURL string
OTLPEndpoint string
}
// Load 从环境变量加载配置并提供默认值
func Load() *Config {
return &Config{
Port: getEnv("PUSH_GATEWAY_PORT", "8081"),
JWTSecret: getEnv("JWT_SECRET", "p1-dev-secret-change-in-production"),
DevMode: getEnv("DEV_MODE", "false") == "true",
RedisURL: getEnv("REDIS_URL", ""),
Port: getEnv("PUSH_GATEWAY_PORT", "8081"),
JWTSecret: getEnv("JWT_SECRET", "p1-dev-secret-change-in-production"),
DevMode: getEnv("DEV_MODE", "false") == "true",
RedisURL: getEnv("REDIS_URL", ""),
OTLPEndpoint: getEnv("OTEL_EXPORTER_OTLP_ENDPOINT", "http://localhost:4318"),
}
}