Skip to content

Commit

Permalink
chore: set service name explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jan 31, 2025
1 parent f91f78d commit 6008da3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
15 changes: 1 addition & 14 deletions internal/cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"github.com/go-faster/sdk/zctx"
"github.com/spf13/cobra"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
"go.uber.org/zap"

"github.com/go-faster/simon/internal/app"
Expand Down Expand Up @@ -75,18 +73,7 @@ func cmdClient() *cobra.Command {
}
}
},
sdka.WithResource(func(ctx context.Context) (*resource.Resource, error) {
return resource.New(ctx,
resource.WithOS(),
resource.WithFromEnv(),
resource.WithTelemetrySDK(),
resource.WithHost(),
resource.WithProcess(),
resource.WithAttributes(
attribute.String("service.name", "simon.client"),
),
)
}),
sdka.WithServiceName("simon.client"),
)
},
}
Expand Down
15 changes: 1 addition & 14 deletions internal/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
"github.com/rs/cors"
"github.com/spf13/cobra"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -108,18 +106,7 @@ func cmdServer() *cobra.Command {
})
return g.Wait()
},
sdka.WithResource(func(ctx context.Context) (*resource.Resource, error) {
return resource.New(ctx,
resource.WithOS(),
resource.WithFromEnv(),
resource.WithTelemetrySDK(),
resource.WithHost(),
resource.WithProcess(),
resource.WithAttributes(
attribute.String("service.name", "simon.server"),
),
)
}),
sdka.WithServiceName("simon.server"),
)
},
}
Expand Down

0 comments on commit 6008da3

Please sign in to comment.