-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add DB metrics & traces: Redis, MySQL #623
Add DB metrics & traces: Redis, MySQL #623
Conversation
[WARNING:INTCFG] Changes in |
Best reviewed: commit by commit
Optimal code review plan (2 warnings)
|
[CHATOPS:HELP] ChatOps commands.
|
Codecov Report
@@ Coverage Diff @@
## master #623 +/- ##
==========================================
+ Coverage 14.41% 14.61% +0.19%
==========================================
Files 409 411 +2
Lines 21519 21573 +54
==========================================
+ Hits 3103 3153 +50
- Misses 18141 18143 +2
- Partials 275 277 +2
Continue to review full report at Codecov.
|
40c5e70
to
22227d0
Compare
938a605
to
3a3c7d9
Compare
@@ -25,6 +25,13 @@ import ( | |||
|
|||
var ( | |||
enabled bool | |||
|
|||
BoolAttribute = trace.BoolAttribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
BoolAttribute
is a global variable (gochecknoglobals)
@@ -25,6 +25,13 @@ import ( | |||
|
|||
var ( | |||
enabled bool | |||
|
|||
BoolAttribute = trace.BoolAttribute | |||
Float64Attribute = trace.Float64Attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
Float64Attribute
is a global variable (gochecknoglobals)
|
||
BoolAttribute = trace.BoolAttribute | ||
Float64Attribute = trace.Float64Attribute | ||
Int64Attribute = trace.Int64Attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
Int64Attribute
is a global variable (gochecknoglobals)
BoolAttribute = trace.BoolAttribute | ||
Float64Attribute = trace.Float64Attribute | ||
Int64Attribute = trace.Int64Attribute | ||
StringAttribute = trace.StringAttribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
StringAttribute
is a global variable (gochecknoglobals)
Int64Attribute = trace.Int64Attribute | ||
StringAttribute = trace.StringAttribute | ||
|
||
FromContext = trace.FromContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
FromContext
is a global variable (gochecknoglobals)
} | ||
|
||
return []*metrics.View{ | ||
&metrics.View{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
3a3c7d9
to
5223959
Compare
type args struct { | ||
ctx context.Context | ||
} | ||
type fields struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
struct of size 296 bytes could be of size 288 bytes (maligned)
}, | ||
want: want{ | ||
wantR: nil, | ||
err: errors.Wrap(errors.Wrap(err, errors.ErrRedisConnectionPingFailed.Error()), context.DeadlineExceeded.Error()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
line is 121 characters (lll)
"github.com/vdaas/vald/internal/observability/trace" | ||
) | ||
|
||
type mysqlMetrics struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
struct of size 56 bytes could be of size 48 bytes (maligned)
|
||
func (mm *mysqlMetrics) View() []*metrics.View { | ||
return []*metrics.View{ | ||
&metrics.View{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
|
||
mm.ms = append( | ||
mm.ms, | ||
mm.queryTotal.M(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 1, in detected (gomnd)
redis "github.com/go-redis/redis/v7" | ||
) | ||
|
||
type Hook = redis.Hook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
exported type Hook
should have comment or be unexported (golint)
) | ||
|
||
type Hook = redis.Hook | ||
type Cmder = redis.Cmder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
exported type Cmder
should have comment or be unexported (golint)
internal/db/kvs/redis/redis.go
Outdated
) | ||
|
||
var ( | ||
// Nil is a type alias of redis.Nil. | ||
Nil = redis.Nil | ||
) | ||
|
||
// Redis is an interface to manipulate Redis server. | ||
type Builder interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
exported type Builder
should have comment or be unexported (golint)
if err := test.checkFunc(test.want, got, err); err != nil { | ||
tt.Errorf("error = %v", err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
unnecessary trailing newline (whitespace)
if der != nil { | ||
r.dialerFunc = der | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
return statements should not be cuddled if block has more than two lines (wsl)
/rebase |
[REBASE] Rebase triggered by rinx for branch: feature/observability/add-db-metrics-redis-mysql |
4689228
to
b955df4
Compare
[FORMAT] Updating license headers and formatting go codes triggered by rinx. |
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Co-authored-by: Yusuke Kato <i.can.feel.gravity@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
Signed-off-by: vdaas-ci <ci@vdaas.org>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
a29c35c
to
f9503cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others Looks Good to me
Co-authored-by: Yusuke Kato <i.can.feel.gravity@gmail.com>
if err != nil { | ||
return nil, err | ||
} | ||
opts = append(opts, mysql.WithTLSConfig(tls)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)
if err != nil { | ||
return nil, err | ||
} | ||
opts = append(opts, mysql.WithDialer(dialer)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)
if err != nil { | ||
return nil, err | ||
} | ||
opts = append(opts, redis.WithTLSConfig(tls)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)
LGTM |
Signed-off-by: Rintaro Okamura rintaro.okamura@gmail.com
Description:
Added DB metrics & traces
refactored service layer of meta-redis & manager-backup-mysql
because #626 contains tests for mysql/option.go, this PR should be updated after #626 merged into master branch.
Related Issue:
#343
How Has This Been Tested?:
in our k8s cluster.
Environment:
Types of changes:
Changes to Core Features:
Checklist: