Skip to content

Commit

Permalink
chore: update deps, Jaeger -> OTLP (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
skandragon authored Feb 16, 2024
1 parent 03f3230 commit 657e26f
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 95 deletions.
13 changes: 6 additions & 7 deletions app/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ var (
tickTime = flag.Int("tickTime", 10, "Time between sending Ping messages")
configFile = flag.String("configFile", "/app/config/config.yaml", "The file with the controller config")

// eg, http://localhost:14268/api/traces
jaegerEndpoint = flag.String("jaeger-endpoint", "", "Jaeger collector endpoint")
traceToStdout = flag.Bool("traceToStdout", false, "log traces to stdout")
traceRatio = flag.Float64("traceRatio", 0.01, "ratio of traces to create, if incoming request is not traced")
showversion = flag.Bool("version", false, "show the version and exit")
profile = flag.Bool("profile", false, "enable memory and CPU profiling")
otlpEndpoint = flag.String("otlp-endpoint", "", "OTLP collector endpoint")
traceToStdout = flag.Bool("traceToStdout", false, "log traces to stdout")
traceRatio = flag.Float64("traceRatio", 0.01, "ratio of traces to create, if incoming request is not traced")
showversion = flag.Bool("version", false, "show the version and exit")
profile = flag.Bool("profile", false, "enable memory and CPU profiling")

hostname = getHostname()

Expand Down Expand Up @@ -388,7 +387,7 @@ func main() {
)

var err error
tracerProvider, err = tracer.NewTracerProvider(*jaegerEndpoint, *traceToStdout, version.GitHash(), appName, *traceRatio)
tracerProvider, err = tracer.NewTracerProvider(ctx, *otlpEndpoint, *traceToStdout, version.GitHash(), appName, *traceRatio)
util.Check(err)
defer tracerProvider.Shutdown(ctx)

Expand Down
8 changes: 4 additions & 4 deletions app/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
configFile = flag.String("configFile", "/app/config/config.yaml", "The file with the controller config")

// eg, http://localhost:14268/api/traces
jaegerEndpoint = flag.String("jaeger-endpoint", "", "Jaeger collector endpoint")
otlpEndpoint = flag.String("otlp-endpoint", "", "OTLP collector endpoint")
traceToStdout = flag.Bool("traceToStdout", false, "log traces to stdout")
traceRatio = flag.Float64("traceRatio", 0.01, "ratio of traces to create, if incoming request is not traced")
showversion = flag.Bool("version", false, "show the version and exit")
Expand Down Expand Up @@ -262,12 +262,12 @@ func main() {
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, syscall.SIGTERM, syscall.SIGINT)

if *jaegerEndpoint != "" {
*jaegerEndpoint = util.GetEnvar("JAEGER_TRACE_URL", "")
if *otlpEndpoint != "" {
*otlpEndpoint = util.GetEnvar("OTLP_URL", "")
}

var err error
tracerProvider, err = tracer.NewTracerProvider(*jaegerEndpoint, *traceToStdout, version.GitHash(), appName, *traceRatio)
tracerProvider, err = tracer.NewTracerProvider(ctx, *otlpEndpoint, *traceToStdout, version.GitHash(), appName, *traceRatio)
util.Check(err)
defer tracerProvider.Shutdown(ctx)

Expand Down
56 changes: 30 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/opsmx/oes-birger
go 1.21

require (
github.com/OpsMx/go-app-base v0.0.21
github.com/OpsMx/go-app-base v0.0.23
github.com/go-resty/resty/v2 v2.11.0
github.com/google/go-cmp v0.6.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
Expand All @@ -13,34 +13,36 @@ require (
github.com/skandragon/jwtregistry/v2 v2.0.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.26.0
golang.org/x/net v0.19.0
google.golang.org/grpc v1.60.1
golang.org/x/net v0.21.0
google.golang.org/grpc v1.61.1
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -50,37 +52,39 @@ require (
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/sdk v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240209001042-7a0d5b415232 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading

0 comments on commit 657e26f

Please sign in to comment.