Skip to content

Commit

Permalink
use new otel-init-go location & API
Browse files Browse the repository at this point in the history
Signed-off-by: Amy Tobey <[email protected]>
  • Loading branch information
Amy Tobey committed Aug 25, 2021
1 parent 966cd74 commit 3eed86f
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 898 deletions.
9 changes: 4 additions & 5 deletions cmd/tink-cli/main.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package main

import (
"context"
"fmt"
"os"

"github.com/equinix-labs/otel-init-go/otelinit"
"github.com/tinkerbell/tink/cmd/tink-cli/cmd"
"github.com/tobert/otel-launcher-go/launcher"
)

// version is set at build time
var version = "devel"

func main() {
otel := launcher.ConfigureOpentelemetry(
launcher.WithServiceName("github.com/tinkerbell/tink"),
)
defer otel.Shutdown()
ctx, otelShutdown := otelinit.InitOpenTelemetry(context.Background(), "github.com/tinkerbell/tink")
defer otelShutdown(ctx)

if err := cmd.Execute(version); err != nil {
fmt.Fprintln(os.Stderr, err.Error())
Expand Down
11 changes: 5 additions & 6 deletions cmd/tink-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"strings"
"syscall"

"github.com/equinix-labs/otel-init-go/otelinit"
"github.com/packethost/pkg/log"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/tinkerbell/tink/db"
rpcServer "github.com/tinkerbell/tink/grpc-server"
httpServer "github.com/tinkerbell/tink/http-server"
"github.com/tobert/otel-launcher-go/launcher"
)

var (
Expand Down Expand Up @@ -103,15 +103,14 @@ func main() {
}
defer logger.Close()

otel := launcher.ConfigureOpentelemetry(
launcher.WithServiceName("github.com/tinkerbell/tink"),
)
defer otel.Shutdown()
ctx := context.Background()
ctx, otelShutdown := otelinit.InitOpenTelemetry(ctx, "github.com/tinkerbell/tink")
defer otelShutdown(ctx)

config := &DaemonConfig{}

cmd := NewRootCommand(config, logger)
if err := cmd.ExecuteContext(context.Background()); err != nil {
if err := cmd.ExecuteContext(ctx); err != nil {
os.Exit(1)
}

Expand Down
9 changes: 4 additions & 5 deletions cmd/tink-worker/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package main

import (
"context"
"os"

"github.com/equinix-labs/otel-init-go/otelinit"
"github.com/packethost/pkg/log"
"github.com/tinkerbell/tink/cmd/tink-worker/cmd"
"github.com/tobert/otel-launcher-go/launcher"
)

const (
Expand All @@ -24,10 +25,8 @@ func main() {
}
defer logger.Close()

otel := launcher.ConfigureOpentelemetry(
launcher.WithServiceName("github.com/tinkerbell/tink"),
)
defer otel.Shutdown()
ctx, otelShutdown := otelinit.InitOpenTelemetry(context.Background(), "github.com/tinkerbell/tink")
defer otelShutdown(ctx)

rootCmd := cmd.NewRootCommand(version, logger)

Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ go 1.13

require (
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-units v0.4.0 // indirect
github.com/equinix-labs/otel-init-go v0.0.1
github.com/go-openapi/strfmt v0.19.3 // indirect
github.com/golang/protobuf v1.5.0
github.com/google/go-cmp v0.5.5
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.6
github.com/google/uuid v1.1.2
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/jedib0t/go-pretty v4.3.0+incompatible
github.com/lib/pq v1.2.1-0.20191011153232-f91d3411e481
github.com/moby/sys/mount v0.2.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/packethost/pkg v0.0.0-20200903155310-0433e0605550
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
Expand All @@ -27,16 +29,14 @@ require (
github.com/stretchr/testify v1.7.0
github.com/testcontainers/testcontainers-go v0.9.0
go.mongodb.org/mongo-driver v1.1.2 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.22.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/tools v0.1.0 // indirect
google.golang.org/genproto v0.0.0-20201026171402-d4b8fe4fd877
google.golang.org/grpc v1.32.0
google.golang.org/protobuf v1.26.0
gopkg.in/yaml.v2 v2.3.0
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
google.golang.org/grpc v1.39.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
gotest.tools v2.2.0+incompatible // indirect
gotest.tools/v3 v3.0.3 // indirect
)

replace github.com/stormcat24/protodep => github.com/ackintosh/protodep v0.0.0-20200728152107-abf8eb579d6c
Loading

0 comments on commit 3eed86f

Please sign in to comment.