From 87de3a43bbe537bb42e7bc46eeec9c91e9ea9049 Mon Sep 17 00:00:00 2001 From: Felipe Cavalcanti Date: Mon, 29 Jul 2024 16:40:10 -0300 Subject: [PATCH] chore: remove process and os info from traces --- examples/demo/cluster/main.go | 11 ++--------- pkg/tracing/otel.go | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/examples/demo/cluster/main.go b/examples/demo/cluster/main.go index 3d67916c..8967dcad 100644 --- a/examples/demo/cluster/main.go +++ b/examples/demo/cluster/main.go @@ -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" @@ -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) @@ -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 { diff --git a/pkg/tracing/otel.go b/pkg/tracing/otel.go index 00f5e0e2..56fec6e1 100644 --- a/pkg/tracing/otel.go +++ b/pkg/tracing/otel.go @@ -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