mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-18 07:56:56 +00:00
* chore(api_key): add api key analytics * feat(analytics): move frontend events * feat(analytics): add collect config * feat(analytics): add collect config * feat(analytics): fix traits * feat(analytics): fix traits * feat(analytics): fix traits * feat(analytics): fix traits * feat(analytics): fix traits * feat(analytics): fix factor api key * fix(analytics): fix org stats * fix(analytics): fix org stats
54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package noopanalytics
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/SigNoz/signoz/pkg/analytics"
|
|
"github.com/SigNoz/signoz/pkg/factory"
|
|
"github.com/SigNoz/signoz/pkg/types/analyticstypes"
|
|
)
|
|
|
|
type provider struct {
|
|
stopC chan struct{}
|
|
}
|
|
|
|
func NewFactory() factory.ProviderFactory[analytics.Analytics, analytics.Config] {
|
|
return factory.NewProviderFactory(factory.MustNewName("noop"), New)
|
|
}
|
|
|
|
func New(ctx context.Context, providerSettings factory.ProviderSettings, config analytics.Config) (analytics.Analytics, error) {
|
|
return &provider{
|
|
stopC: make(chan struct{}),
|
|
}, nil
|
|
}
|
|
|
|
func (provider *provider) Start(_ context.Context) error {
|
|
<-provider.stopC
|
|
return nil
|
|
}
|
|
|
|
func (provider *provider) Send(ctx context.Context, messages ...analyticstypes.Message) {
|
|
// do nothing
|
|
}
|
|
|
|
func (provider *provider) TrackGroup(ctx context.Context, group, event string, attributes map[string]any) {
|
|
// do nothing
|
|
}
|
|
|
|
func (provider *provider) TrackUser(ctx context.Context, group, user, event string, attributes map[string]any) {
|
|
// do nothing
|
|
}
|
|
|
|
func (provider *provider) IdentifyGroup(ctx context.Context, group string, traits map[string]any) {
|
|
// do nothing
|
|
}
|
|
|
|
func (provider *provider) IdentifyUser(ctx context.Context, group, user string, traits map[string]any) {
|
|
// do nothing
|
|
}
|
|
|
|
func (provider *provider) Stop(_ context.Context) error {
|
|
close(provider.stopC)
|
|
return nil
|
|
}
|