Skip to content

Commit

Permalink
Merge pull request #64 from tobert/add-opentelemetry
Browse files Browse the repository at this point in the history
add opentelemetry
  • Loading branch information
tstromberg authored Aug 30, 2021
2 parents b0ea1a5 + 4ac4930 commit 2c3a161
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 40 deletions.
5 changes: 5 additions & 0 deletions cmd/hegel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"syscall"
"time"

"github.com/equinix-labs/otel-init-go/otelinit"
"github.com/packethost/pkg/env"
"github.com/packethost/pkg/log"
grpcserver "github.com/tinkerbell/hegel/grpc-server"
Expand All @@ -34,6 +35,10 @@ func main() {
defer l.Close()
metrics.Init(l)

ctx := context.Background()
ctx, otelShutdown := otelinit.InitOpenTelemetry(ctx, "hegel")
defer otelShutdown(ctx)

metrics.State.Set(metrics.Initializing)

hegelServer, err := grpcserver.NewServer(l, nil)
Expand Down
9 changes: 7 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module github.com/tinkerbell/hegel
go 1.13

require (
github.com/golang/protobuf v1.4.2
github.com/equinix-labs/otel-init-go v0.0.1
github.com/golang/protobuf v1.5.2
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/itchyny/gojq v0.11.0
Expand All @@ -13,6 +14,10 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.6.0
github.com/tinkerbell/tink v0.0.0-20201207184750-9c52cca562bc
google.golang.org/grpc v1.32.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.22.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.22.0
go.opentelemetry.io/otel v1.0.0-RC2
go.opentelemetry.io/otel/trace v1.0.0-RC2
google.golang.org/grpc v1.39.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)
Loading

0 comments on commit 2c3a161

Please sign in to comment.