Skip to content

Commit

Permalink
add new metric for pubsub duration in seconds (#46)
Browse files Browse the repository at this point in the history
* upgrade deps

* add explicit buckets

* add more logs
  • Loading branch information
lghinet authored Dec 6, 2023
1 parent f1b1a82 commit c8ff595
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 120 deletions.
7 changes: 6 additions & 1 deletion cmd/rusid/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func main() {
//https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md
klog.InitFlags(nil)
defer klog.Flush()
klog.InfoS("Rusid is starting")

cfgBuilder := runtime.NewRuntimeConfigBuilder()
cfgBuilder.AttachCmdFlags(flag.StringVar, flag.BoolVar, flag.IntVar)
Expand All @@ -47,26 +48,30 @@ func main() {
if cfg.Mode == modes.KubernetesMode {
compLoader = operator.GetComponentsWatcher(mainCtx, cfg.ControlPlaneAddress, wg)
configLoader = operator.GetConfigurationWatcher(mainCtx, cfg.ControlPlaneAddress, cfg.Config, wg)
klog.InfoS("KubernetesMode enabled")
}

//setup tracing
go diagnostics.WatchConfig(mainCtx, configLoader, tracing.SetJaegerTracing(cfg.AppID))
klog.InfoS("Setup opentelemetry finished")

compManager, err := runtime.NewComponentsManager(mainCtx, cfg.AppID, compLoader,
RegisterComponentFactories()...)
if err != nil {
klog.Error(err)
return
}
klog.InfoS("Components manager is running")

api := grpc_api.NewGrpcAPI(cfg.RusiGRPCPort)
klog.InfoS("Rusi grpc server is running")
rt, err := runtime.NewRuntime(mainCtx, cfg, api, configLoader, compManager)
if err != nil {
klog.Error(err)
return
}

klog.InfoS("Rusid is starting", "port", cfg.RusiGRPCPort,
klog.InfoS("Rusid is started", "port", cfg.RusiGRPCPort,
"app id", cfg.AppID, "mode", cfg.Mode, "version", version.Version(),
"git commit", version.Commit(), "git version", version.GitVersion())
klog.InfoS("Rusid is using", "config", cfg)
Expand Down
58 changes: 29 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ go 1.21
//https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies

require (
github.com/google/uuid v1.3.1
github.com/google/uuid v1.4.0
github.com/json-iterator/go v1.1.12
github.com/kelseyhightower/envconfig v1.4.0
github.com/nats-io/nats.go v1.31.0
github.com/nats-io/stan.go v0.10.4
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/contrib/propagators/jaeger v1.20.0
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
go.opentelemetry.io/otel/exporters/prometheus v0.42.0
go.opentelemetry.io/otel/metric v1.19.0
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/sdk/metric v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
golang.org/x/sync v0.4.0
go.opentelemetry.io/contrib/propagators/jaeger v1.21.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/exporters/prometheus v0.44.0
go.opentelemetry.io/otel/metric v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/sdk/metric v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
golang.org/x/sync v0.5.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.28.3
k8s.io/apiextensions-apiserver v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/klog/v2 v2.100.1
k8s.io/api v0.28.4
k8s.io/apiextensions-apiserver v0.28.4
k8s.io/apimachinery v0.28.4
k8s.io/client-go v0.28.4
k8s.io/klog/v2 v2.110.1
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

Expand All @@ -40,43 +40,43 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // 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/nats-io/nats-server/v2 v2.10.3 // indirect
github.com/nats-io/nats-streaming-server v0.25.5 // indirect
github.com/nats-io/nkeys v0.4.5 // indirect
github.com/nats-io/nats-server/v2 v2.10.5 // indirect
github.com/nats-io/nats-streaming-server v0.25.6 // indirect
github.com/nats-io/nkeys v0.4.6 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/term v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
Expand Down
Loading

0 comments on commit c8ff595

Please sign in to comment.