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
45 lines
699 B
Go
45 lines
699 B
Go
package analytics
|
|
|
|
import (
|
|
"github.com/hanzoai/o11y/pkg/factory"
|
|
)
|
|
|
|
// This will be set via ldflags at build time.
|
|
var (
|
|
key string = "<unset>"
|
|
)
|
|
|
|
type Config struct {
|
|
Enabled bool `mapstructure:"enabled"`
|
|
Segment Segment `mapstructure:"segment"`
|
|
}
|
|
|
|
type Segment struct {
|
|
Key string `mapstructure:"key"`
|
|
}
|
|
|
|
func NewConfigFactory() factory.ConfigFactory {
|
|
return factory.NewConfigFactory(factory.MustNewName("analytics"), newConfig)
|
|
}
|
|
|
|
func newConfig() factory.Config {
|
|
return Config{
|
|
Enabled: false,
|
|
Segment: Segment{
|
|
Key: key,
|
|
},
|
|
}
|
|
}
|
|
|
|
func (c Config) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
func (c Config) Provider() string {
|
|
if c.Enabled {
|
|
return "segment"
|
|
}
|
|
|
|
return "noop"
|
|
}
|