Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted deprecated dependency for OTEL #1795

Merged
merged 41 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ac1e917
deleted prometheus controller
hlts2 Sep 29, 2022
d480dd3
add viewer interface for registering instrucment view
hlts2 Sep 29, 2022
0c705a6
add view register logic
hlts2 Sep 29, 2022
7c03d93
add prometheus exporter logic
hlts2 Sep 29, 2022
cdd3858
tweak
hlts2 Sep 29, 2022
f541e59
deleted unused file
hlts2 Sep 29, 2022
c6237e6
add otel trace interceptor
hlts2 Sep 29, 2022
77d4df4
add register otel view
hlts2 Sep 29, 2022
78d6e66
refactor
hlts2 Sep 29, 2022
1a3250b
deleted unused option and bugfix of registration for global meter pro…
hlts2 Sep 29, 2022
6d1f171
make schema update
hlts2 Sep 29, 2022
9072071
run gofumpt
hlts2 Sep 29, 2022
072fb8d
make format
hlts2 Sep 29, 2022
55b7632
add instrument kind
hlts2 Sep 29, 2022
553d7d2
fix aggregation type
hlts2 Sep 29, 2022
898f60b
fix incompatible aggregation error
hlts2 Sep 29, 2022
62b0d0d
fix nil pointer bug when tracer disabled
hlts2 Sep 29, 2022
2be32e6
add grpc interceptor metrics view
hlts2 Sep 29, 2022
f62a2a0
make gotest/gen & make format
hlts2 Sep 29, 2022
ce855d5
register grpc view
hlts2 Sep 30, 2022
1400220
make gotest/gen and make format
hlts2 Sep 30, 2022
ddc3226
Merge branch 'main' into fix/internal/fix-deplicated-otel-package
hlts2 Sep 30, 2022
133d9f0
bugfix of creation for metric interceptor
hlts2 Oct 3, 2022
13f06b8
make format
hlts2 Oct 3, 2022
d2f639b
fix go mod default
hlts2 Oct 3, 2022
2567fe4
go mod tidy
hlts2 Oct 3, 2022
312c97c
Merge branch 'main' into fix/internal/fix-deplicated-otel-package
hlts2 Oct 3, 2022
15704d1
update dependencies and manifests
kpango Oct 3, 2022
ea53c33
downgrade NGT version to non QBG deps
kpango Oct 3, 2022
a5e4327
fix kubelinter installation failure
kpango Oct 3, 2022
d91304d
fix snyk high vuln
kpango Oct 3, 2022
a3efeeb
fix
kpango Oct 3, 2022
39a1286
add web ui to go.mod.default
hlts2 Oct 4, 2022
a7b34fb
tweak
hlts2 Oct 4, 2022
e99d5e5
fix snyk high vuln
hlts2 Oct 4, 2022
cb5b697
Revert "fix snyk high vuln"
hlts2 Oct 4, 2022
d8769bc
fix snyk high vuln
hlts2 Oct 4, 2022
f49aa2d
Revert "fix snyk high vuln"
hlts2 Oct 4, 2022
cc75fc7
deleted unused deps
hlts2 Oct 4, 2022
59e2c73
fix chaos version to latest
hlts2 Oct 4, 2022
14a09d1
kubectl version lock
hlts2 Oct 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions charts/vald-helm-operator/crds/valdrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -1337,12 +1331,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -2255,12 +2243,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -3152,12 +3134,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -4594,12 +4570,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -5831,12 +5801,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down Expand Up @@ -7054,12 +7018,6 @@ spec:
prometheus:
type: object
properties:
collect_interval:
type: string
collect_timeout:
type: string
enable_in_memory_mode:
type: boolean
enabled:
type: boolean
endpoint:
Expand Down
4 changes: 1 addition & 3 deletions charts/vald/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,7 @@ trace:
prometheus:
{{- if .Values.prometheus }}
enabled: {{ default .default.prometheus.enabled .Values.prometheus.enabled }}
collect_interval: {{ default .default.prometheus.collect_interval .Values.prometheus.collect_interval | quote }}
collect_timeout: {{ default .default.prometheus.collect_timeout .Values.prometheus.collect_timeout | quote }}
enable_in_memory_mode: {{ default .default.prometheus.enable_in_memory_mode .Values.prometheus.enable_in_memory_mode }}
endpoint: {{ default .default.prometheus.endpoint .Values.prometheus.endpoint | quote }}
{{- else }}
{{- toYaml .default.prometheus | nindent 2 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/vald/values.schema.json

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions charts/vald/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,6 @@ defaults:
# @schema {"name": "defaults.observability.prometheus.namespace", "type": "string"}
# defaults.observability.prometheus.namespace -- service namespace for metrics
namespace: _MY_POD_NAMESPACE_
# @schema {"name": "defaults.observability.prometheus.collect_interval", "type": "string"}
# defaults.observability.prometheus.collect_interval -- Prometheus collect interval
collect_interval: 500ms
# @schema {"name": "defaults.observability.prometheus.collect_timeout", "type": "string"}
# defaults.observability.prometheus.collect_timeout -- Prometheus collect timeout
collect_timeout: 10s
# @schema {"name": "defaults.observability.prometheus.enable_in_memory_mode", "type": "boolean"}
# defaults.observability.prometheus.enable_in_memory_mode -- Prometheus collect with in memory
enable_in_memory_mode: true
# @schema {"name": "defaults.observability.jaeger", "type": "object"}
jaeger:
# @schema {"name": "defaults.observability.jaeger.enabled", "type": "boolean"}
Expand Down
34 changes: 9 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -471,22 +471,6 @@ replace (
go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver v1.10.2
go.mozilla.org/pkcs7 => go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352
go.opencensus.io => go.opencensus.io v0.23.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0
go.opentelemetry.io/otel => go.opentelemetry.io/otel v1.9.0
go.opentelemetry.io/otel/exporters/jaeger => go.opentelemetry.io/otel/exporters/jaeger v1.9.0
go.opentelemetry.io/otel/exporters/otlp => go.opentelemetry.io/otel/exporters/otlp v0.20.0
go.opentelemetry.io/otel/exporters/otlp/internal/retry => go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.9.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace => go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp => go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.9.0
go.opentelemetry.io/otel/exporters/prometheus => go.opentelemetry.io/otel/exporters/prometheus v0.31.0
go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v0.31.0
go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.9.0
go.opentelemetry.io/otel/sdk/export/metric => go.opentelemetry.io/otel/sdk/export/metric v0.28.0
go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v0.31.0
go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.9.0
go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v0.19.0
go.starlark.net => go.starlark.net v0.0.0-20220817180228-f738f5508c12
go.uber.org/atomic => go.uber.org/atomic v1.10.0
go.uber.org/automaxprocs => go.uber.org/automaxprocs v1.5.1
Expand Down Expand Up @@ -589,14 +573,13 @@ require (
github.com/scylladb/gocqlx v0.0.0-00010101000000-000000000000
github.com/vdaas/vald-client-go v0.0.0-00010101000000-000000000000
github.com/zeebo/xxh3 v1.0.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0
go.opentelemetry.io/otel v1.9.0
go.opentelemetry.io/otel/exporters/jaeger v0.0.0-00010101000000-000000000000
go.opentelemetry.io/otel/exporters/prometheus v0.0.0-00010101000000-000000000000
go.opentelemetry.io/otel/metric v0.31.0
go.opentelemetry.io/otel/sdk v1.9.0
go.opentelemetry.io/otel/sdk/metric v0.31.0
go.opentelemetry.io/otel/trace v1.9.0
go.opentelemetry.io/otel v1.10.0
go.opentelemetry.io/otel/exporters/jaeger v1.10.0
go.opentelemetry.io/otel/exporters/prometheus v0.32.1
go.opentelemetry.io/otel/metric v0.32.1
go.opentelemetry.io/otel/sdk v1.10.0
go.opentelemetry.io/otel/sdk/metric v0.32.1
go.opentelemetry.io/otel/trace v1.10.0
go.uber.org/automaxprocs v0.0.0-00010101000000-000000000000
go.uber.org/goleak v1.1.12
go.uber.org/zap v1.23.0
Expand All @@ -610,7 +593,7 @@ require (
gonum.org/v1/hdf5 v0.0.0-00010101000000-000000000000
gonum.org/v1/plot v0.0.0-00010101000000-000000000000
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc
google.golang.org/grpc v1.48.0
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
gopkg.in/yaml.v2 v2.4.0
inet.af/netaddr v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -688,6 +671,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
Expand Down
34 changes: 17 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -468,23 +468,23 @@ github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc=
go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw=
go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo=
go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww=
go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs=
go.opentelemetry.io/otel/exporters/prometheus v0.31.0 h1:jwtnOGBM8dIty5AVZ+9ZCzZexCea3aVKmUfZAQcHqxs=
go.opentelemetry.io/otel/exporters/prometheus v0.31.0/go.mod h1:QarXIB8L79IwIPoNgG3A6zNvBgVmcppeFogV1d8612s=
go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A=
go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo=
go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4=
go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q=
go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk=
go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc=
go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1 h1:RQxI9u7XGv+E9x35YWa3jZhdpsphaV7VvBArNSiDtMw=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.36.1/go.mod h1:ylJH0hLC6Bp40dYp8rctk9HIuEM/xQRbV05d9HGTktQ=
go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw=
go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA=
go.opentelemetry.io/otel/exporters/prometheus v0.32.1 h1:1+iSNGGCYoDAMuFDN2M+sYTwa5/wApb7yO/GpW5Vtzg=
go.opentelemetry.io/otel/exporters/prometheus v0.32.1/go.mod h1:t1ZclNSxaC2ztzbHxGU71mg3pkkaHyHcMUIK2Yvft0E=
go.opentelemetry.io/otel/metric v0.32.1 h1:ftff5LSBCIDwL0UkhBuDg8j9NNxx2IusvJ18q9h6RC4=
go.opentelemetry.io/otel/metric v0.32.1/go.mod h1:iLPP7FaKMAD5BIxJ2VX7f2KTuz//0QK2hEUyti5psqQ=
go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
go.opentelemetry.io/otel/sdk/metric v0.32.1 h1:S6AqzulzGQl+sTpYeAoVLw1SJbc2LYuKCMUmfEKG+zM=
go.opentelemetry.io/otel/sdk/metric v0.32.1/go.mod h1:Nn+Nt/7cKzm5ISmvLzNO5RLf0Xuv8/Qo8fkpr0JDOzs=
go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.starlark.net v0.0.0-20220817180228-f738f5508c12 h1:xOBJXWGEDwU5xSDxH6macxO11Us0AH2fTa9rmsbbF7g=
go.starlark.net v0.0.0-20220817180228-f738f5508c12/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
Expand Down
11 changes: 3 additions & 8 deletions internal/config/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ type Metrics struct {

// Prometheus represents the configuration for the prometheus.
type Prometheus struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
Namespace string `json:"namespace" yaml:"namespace"`
CollectInterval string `json:"collect_interval" yaml:"collect_interval"`
CollectTimeout string `json:"collect_timeout" yaml:"collect_timeout"`
EnableInMemoryMode bool `json:"enable_in_memory_mode" yaml:"enable_in_memory_mode"`
Enabled bool `json:"enabled" yaml:"enabled"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
Namespace string `json:"namespace" yaml:"namespace"`
}

// Jaeger represents the configuration for the jaeger.
Expand Down Expand Up @@ -85,8 +82,6 @@ func (o *Observability) Bind() *Observability {
if o.Prometheus != nil {
o.Prometheus.Endpoint = GetActualValue(o.Prometheus.Endpoint)
o.Prometheus.Namespace = GetActualValue(o.Prometheus.Namespace)
o.Prometheus.CollectInterval = GetActualValue(o.Prometheus.CollectInterval)
o.Prometheus.CollectTimeout = GetActualValue(o.Prometheus.CollectTimeout)
} else {
o.Prometheus = new(Prometheus)
}
Expand Down
62 changes: 12 additions & 50 deletions internal/observability/exporter/prometheus/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,15 @@
package prometheus

import (
"time"

"github.com/vdaas/vald/internal/errors"
"github.com/vdaas/vald/internal/observability/exporter"
"github.com/vdaas/vald/internal/observability/metrics"
)

type Option func(e *exp) error

var defaultOpts = []Option{
WithEndpoint("/metrics"),
WithNamespace("vald"),
WithCollectInterval("500ms"),
WithCollectTimeout("10s"),
WithInMemoty(true),
WithHistogramDistribution(
exporter.DefaultMillisecondsHistogramDistribution,
),
}

func WithEndpoint(ep string) Option {
Expand All @@ -53,49 +45,19 @@ func WithNamespace(ns string) Option {
}
}

func WithCollectInterval(period string) Option {
return func(e *exp) error {
if len(period) == 0 {
return errors.NewErrInvalidOption("collectInterval", period)
}

dur, err := time.ParseDuration(period)
if err != nil {
return errors.NewErrInvalidOption("collectInterval", period, err)
}
e.collectInterval = dur
return nil
}
}

func WithCollectTimeout(timeout string) Option {
return func(e *exp) error {
if len(timeout) == 0 {
return errors.NewErrInvalidOption("collectTimeout", timeout)
}

dur, err := time.ParseDuration(timeout)
if err != nil {
return errors.NewErrInvalidOption("collectTimeout", timeout, err)
}
e.collectTimeout = dur
return nil
}
}

func WithInMemoty(ok bool) Option {
return func(e *exp) error {
e.inmemoryEnabled = ok
return nil
}
}

func WithHistogramDistribution(fs []float64) Option {
func WithView(viewers ...metrics.Viewer) Option {
return func(e *exp) error {
if len(fs) == 0 {
return errors.NewErrInvalidOption("histogramBoundarie", fs)
views := make([]metrics.View, 0, len(viewers))
for _, viewer := range viewers {
vs, err := viewer.View()
if err != nil {
return errors.NewErrCriticalOption("view", viewer, err)
}
for _, v := range vs {
views = append(views, *v)
}
}
e.histogramBoundarie = fs
e.views = append(e.views, views...)
return nil
}
}
Loading