signoz/pkg/config/config.go
Vibhu Pandey 939ab5270e
feat(instrumentation): use new config factory (#6834)
### Summary

Use new config factory and remove redundant configuration possibilities from the upstream
2025-01-17 14:54:33 +05:30

35 lines
827 B
Go

package config
import (
"context"
"go.signoz.io/signoz/pkg/cache"
signozconfmap "go.signoz.io/signoz/pkg/confmap"
"go.signoz.io/signoz/pkg/instrumentation"
"go.signoz.io/signoz/pkg/web"
)
// This map contains the default values of all config structs
var (
defaults = map[string]signozconfmap.Config{
"web": &web.Config{},
"cache": &cache.Config{},
}
)
// Config defines the entire configuration of signoz.
type Config struct {
Instrumentation instrumentation.Config `mapstructure:"instrumentation"`
Web web.Config `mapstructure:"web"`
Cache cache.Config `mapstructure:"cache"`
}
func New(ctx context.Context, settings ProviderSettings) (*Config, error) {
provider, err := NewProvider(settings)
if err != nil {
return nil, err
}
return provider.Get(ctx)
}