Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

578 B
Raw Blame
package licensing

import (
	"sync"
	"time"

	"github.com/SigNoz/signoz/pkg/errors"
	"github.com/SigNoz/signoz/pkg/licensing"
)

var (
	config licensing.Config
	once   sync.Once
)

// Config initializes the licensing configuration.
func Config(pollInterval time.Duration, failureThreshold int) licensing.Config {
	once.Do(func() {
		config = licensing.Config{PollInterval: pollInterval, FailureThreshold: failureThreshold}
		if err := config.Validate(); err != nil {
			panic(errors.WrapInternalf(err, errors.CodeInternal, "invalid licensing config"))
		}
	})

	return config
}