Skip to content

Commit

Permalink
fix: move telemetry config to root (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh authored Jun 11, 2024
1 parent 8b13e15 commit 54c5de2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func StartServer(logger *log.Zap, cfg *config.Shield) error {
ctx, cancelFunc := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT)
defer cancelFunc()

cleanUpTelemetry, err := telemetry.Init(ctx, cfg.App.Telemetry, logger)
cleanUpTelemetry, err := telemetry.Init(ctx, cfg.Telemetry, logger)
if err != nil {
return err
}
Expand Down
16 changes: 9 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"

"github.com/goto/salt/config"
"github.com/goto/salt/telemetry"
"github.com/goto/shield/internal/proxy"
"github.com/goto/shield/internal/server"
"github.com/goto/shield/internal/store/spicedb"
Expand All @@ -29,13 +30,14 @@ type ActivityLogConfig struct {

type Shield struct {
// configuration version
Version int `yaml:"version"`
Proxy proxy.ServicesConfig `yaml:"proxy"`
Log Log `yaml:"log"`
NewRelic NewRelic `yaml:"new_relic"`
App server.Config `yaml:"app"`
DB db.Config `yaml:"db"`
SpiceDB spicedb.Config `yaml:"spicedb"`
Version int `yaml:"version"`
Proxy proxy.ServicesConfig `yaml:"proxy"`
Log Log `yaml:"log"`
NewRelic NewRelic `yaml:"new_relic"`
App server.Config `yaml:"app"`
DB db.Config `yaml:"db"`
SpiceDB spicedb.Config `yaml:"spicedb"`
Telemetry telemetry.Config `yaml:"telemetry" mapstructure:"telemetry"`
}

type NewRelic struct {
Expand Down
4 changes: 0 additions & 4 deletions internal/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package server

import (
"fmt"

"github.com/goto/salt/telemetry"
)

type GRPCConfig struct {
Expand All @@ -26,8 +24,6 @@ type Config struct {
// GRPC Config
GRPC GRPCConfig `mapstructure:"grpc"`

Telemetry telemetry.Config `yaml:"telemetry" mapstructure:"telemetry"`

// metrics port
MetricsPort int `yaml:"metrics_port" mapstructure:"metrics_port" default:"9000"`

Expand Down

0 comments on commit 54c5de2

Please sign in to comment.