mirror of
https://github.com/SigNoz/signoz.git
synced 2026-04-28 06:30:33 +01:00
Remove the DeprecatedFlags struct and all associated CLI flags (--max-idle-conns, --max-open-conns, --dial-timeout, --flux-interval, --flux-interval-for-trace-detail, --prefer-span-metrics, --cluster, --gateway-url) that were superseded by environment variable-based configuration. Deprecated environment variable handling is retained. Closes #6805
37 lines
773 B
Go
37 lines
773 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
|
|
"github.com/SigNoz/signoz/pkg/config"
|
|
"github.com/SigNoz/signoz/pkg/config/envprovider"
|
|
"github.com/SigNoz/signoz/pkg/config/fileprovider"
|
|
"github.com/SigNoz/signoz/pkg/signoz"
|
|
)
|
|
|
|
func NewSigNozConfig(ctx context.Context, logger *slog.Logger, configFiles []string) (signoz.Config, error) {
|
|
uris := make([]string, 0, len(configFiles)+1)
|
|
for _, f := range configFiles {
|
|
uris = append(uris, "file:"+f)
|
|
}
|
|
uris = append(uris, "env:")
|
|
|
|
config, err := signoz.NewConfig(
|
|
ctx,
|
|
logger,
|
|
config.ResolverConfig{
|
|
Uris: uris,
|
|
ProviderFactories: []config.ProviderFactory{
|
|
envprovider.NewFactory(),
|
|
fileprovider.NewFactory(),
|
|
},
|
|
},
|
|
)
|
|
if err != nil {
|
|
return signoz.Config{}, err
|
|
}
|
|
|
|
return config, nil
|
|
}
|