mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00

* feat(zeus): add zeus package * feat(signoz): add DI for zeus * feat(zeus): integrate with the codebase * ci(make): change makefile * ci: change workflows to point to the new zeus url * Update ee/query-service/usage/manager.go Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update ee/query-service/license/manager.go Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * fix: fix nil retriable * fix: fix zeus DI * fix: fix path of ldflag * feat(zeus): added zeus integration tests * feat(zeus): added zeus integration tests * feat(zeus): format the pytest --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: vikrantgupta25 <vikrant.thomso@gmail.com> Co-authored-by: Vikrant Gupta <vikrant@signoz.io>
43 lines
803 B
Go
43 lines
803 B
Go
package zeus
|
|
|
|
import (
|
|
"fmt"
|
|
neturl "net/url"
|
|
"sync"
|
|
|
|
"github.com/SigNoz/signoz/pkg/zeus"
|
|
)
|
|
|
|
// This will be set via ldflags at build time.
|
|
var (
|
|
url string = "<unset>"
|
|
deprecatedURL string = "<unset>"
|
|
)
|
|
|
|
var (
|
|
config zeus.Config
|
|
once sync.Once
|
|
)
|
|
|
|
// initializes the Zeus configuration
|
|
func Config() zeus.Config {
|
|
once.Do(func() {
|
|
parsedURL, err := neturl.Parse(url)
|
|
if err != nil {
|
|
panic(fmt.Errorf("invalid zeus URL: %w", err))
|
|
}
|
|
|
|
deprecatedParsedURL, err := neturl.Parse(deprecatedURL)
|
|
if err != nil {
|
|
panic(fmt.Errorf("invalid zeus deprecated URL: %w", err))
|
|
}
|
|
|
|
config = zeus.Config{URL: parsedURL, DeprecatedURL: deprecatedParsedURL}
|
|
if err := config.Validate(); err != nil {
|
|
panic(fmt.Errorf("invalid zeus config: %w", err))
|
|
}
|
|
})
|
|
|
|
return config
|
|
}
|