Skip to content

Commit

Permalink
chore: remove process and os info from traces
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Jul 29, 2024
1 parent e89a2fd commit 87de3a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions examples/demo/cluster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"strings"

"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/topfreegames/pitaya/v3/examples/demo/cluster/services"
pitaya "github.com/topfreegames/pitaya/v3/pkg"
"github.com/topfreegames/pitaya/v3/pkg/acceptor"
Expand Down Expand Up @@ -76,7 +75,7 @@ func configureFrontend(port int) {
}
}

func configureOpenTelemetry(config *viper.Viper, logger logrus.FieldLogger) {
func configureOpenTelemetry(logger logrus.FieldLogger) {
err := tracing.InitializeOtel()
if err != nil {
logger.Errorf("Failed to initialize OpenTelemetry: %v", err)
Expand All @@ -90,13 +89,7 @@ func main() {

flag.Parse()

cfg := viper.New()
cfg.SetDefault("otel.disabled", false)
cfg.SetDefault("otel.probability", 1.0)
cfg.SetDefault("otel.serviceName", "pitaya-"+*svType)
cfg.SetDefault("otel.endpoint", "localhost:4317")

configureOpenTelemetry(cfg, logrus.New())
configureOpenTelemetry(logrus.New())

builder := pitaya.NewDefaultBuilder(*isFrontend, *svType, pitaya.Cluster, map[string]string{}, *config.NewDefaultPitayaConfig())
if *isFrontend {
Expand Down
2 changes: 1 addition & 1 deletion pkg/tracing/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func InitializeOtel() error {

res, err := resource.New(ctx,
resource.WithFromEnv(),
resource.WithProcess(),
resource.WithOS(),
resource.WithHost(),
)
if err != nil {
return err
Expand Down

0 comments on commit 87de3a4

Please sign in to comment.