Skip to content

Commit b915093

Browse files
committed
chore: use WithServiceName
1 parent 23ad610 commit b915093

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

cmd/gh-archived/main.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ import (
1313
"github.com/go-faster/sdk/app"
1414
"github.com/mergestat/timediff"
1515
"go.opentelemetry.io/otel/metric"
16-
semconv "go.opentelemetry.io/otel/semconv/v1.18.0"
1716
"go.uber.org/atomic"
1817
"go.uber.org/zap"
1918
"golang.org/x/sync/errgroup"
2019

2120
"github.com/go-faster/gh-archive-clickhouse/internal/gh"
22-
"github.com/go-faster/gh-archive-clickhouse/internal/otelenv"
2321
)
2422

2523
type Service struct {
@@ -214,12 +212,6 @@ Fetch:
214212
}
215213

216214
func main() {
217-
if err := os.Setenv("OTEL_RESOURCE_ATTRIBUTES", otelenv.Value(
218-
semconv.ServiceNameKey.String("gh-archived"),
219-
semconv.ServiceNamespaceKey.String("faster"),
220-
)); err != nil {
221-
panic(err)
222-
}
223215
app.Run(func(ctx context.Context, lg *zap.Logger, m *app.Telemetry) error {
224216
g, ctx := errgroup.WithContext(ctx)
225217

@@ -282,5 +274,8 @@ func main() {
282274
return s.Send(ctx)
283275
})
284276
return g.Wait()
285-
})
277+
},
278+
app.WithServiceName("gh-archived"),
279+
app.WithServiceNamespace("faster"),
280+
)
286281
}

0 commit comments

Comments
 (0)