Skip to content

Commit 915551e

Browse files
committed
feat: add tracing configuration support
- Added parsing for TRACING_ENABLED, TRACING_SERVICE_NAME, and TRACING_ENDPOINT environment variables - Tracing configuration is now available when promexporter v1.6.1 supports it - Already using promexporter v1.6.1
1 parent 8ea3a62 commit 915551e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/config/config.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ func loadFromEnv() (*Config, error) {
114114
baseConfig.Metrics.Collection.DefaultInterval = promexporter_config.Duration{Duration: time.Second * 30}
115115
}
116116

117+
// Tracing configuration
118+
if enabledStr := os.Getenv("TRACING_ENABLED"); enabledStr != "" {
119+
enabled := enabledStr == "true"
120+
baseConfig.Tracing.Enabled = &enabled
121+
}
122+
123+
if serviceName := os.Getenv("TRACING_SERVICE_NAME"); serviceName != "" {
124+
baseConfig.Tracing.ServiceName = serviceName
125+
}
126+
127+
if endpoint := os.Getenv("TRACING_ENDPOINT"); endpoint != "" {
128+
baseConfig.Tracing.Endpoint = endpoint
129+
}
130+
117131
config.BaseConfig = *baseConfig
118132

119133
// GitHub configuration

0 commit comments

Comments
 (0)