mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Full rebrand of the SigNoz observability platform: - Go module: github.com/SigNoz/signoz → github.com/hanzoai/o11y - Frontend: @signozhq/* → @hanzo/o11y-*, posthog-js → @hanzo/insights - Docker: signoz/* → ghcr.io/hanzoai/o11y* - ClickHouse → Hanzo Datastore (hanzoai/datastore) - Env vars: SIGNOZ_* → HANZO_* - DB tables: signoz_* → o11y_* - All branding, URLs, docs updated - 2172 files changed
37 lines
690 B
Go
37 lines
690 B
Go
package config
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hanzoai/o11y/pkg/factory"
|
|
)
|
|
|
|
func New(ctx context.Context, resolverConfig ResolverConfig, configFactories []factory.ConfigFactory) (*Conf, error) {
|
|
// Get the config from the resolver
|
|
resolver, err := NewResolver(resolverConfig)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
resolvedConf, err := resolver.Do(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
conf := NewConf()
|
|
// Set the default configs
|
|
for _, factory := range configFactories {
|
|
c := factory.New()
|
|
if err := conf.Set(factory.Name().String(), c); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
|
|
err = conf.Merge(resolvedConf)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return conf, nil
|
|
}
|