-
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
[DONT MERGE] Add logic to get backoff metrics #1666
Closed
Closed
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
421501d
add logic to get backoff metrics
hlts2 e98669a
add backoff metrics view
hlts2 3320531
rename variable name
hlts2 57fb78c
add logic to set value into the context
hlts2 6f549bb
fix bug of context value
hlts2 9315c0e
add option for enable/disable metrics
hlts2 2a98372
fix fails test
hlts2 88b2cce
fix deepsource warning
hlts2 307e271
Merge branch 'master' into feature/add-backoff-metrics
hlts2 c432624
fix golangcilint warning
hlts2 eb6f54a
Merge branch 'master' into feature/add-backoff-metrics
hlts2 2893de0
add field of values for backoff metrics
hlts2 66009b6
make helm/schema/vald & make helm/schema/crd/vald
hlts2 d4a4cbd
add metrics configuration
hlts2 0a7133d
refactor and added logic to get metrics
hlts2 7fcbe9d
add logic to get backoff metrics
hlts2 9534597
add grpc method propagation logic
hlts2 db7bd9d
fix nil pointer bug
hlts2 bf913f9
fix lint warning
hlts2 d94cdae
Merge branch 'master' into feature/add-backoff-metrics
hlts2 702ece8
fix lint warning
hlts2 999dde4
fix deepsource error
hlts2 54f3ab3
fix metrics view creation error
hlts2 014b128
fix aggregation method
hlts2 ea9e40e
fix aggregation type
hlts2 66e5eac
change from map delete to zero store
hlts2 e1e0e27
Revert "change from map delete to zero store"
hlts2 f4899ef
zero store and fix aggregation method
hlts2 5c7af01
add debug log
hlts2 00d9988
fix bug of map initialize logic
hlts2 f98545a
change from Count to lastValue
hlts2 012b8b3
change to sum aggregation
hlts2 cbffcda
fix backoff metrics type
hlts2 ed8ff25
fix aggregation type
hlts2 1fbe737
Update internal/observability/metrics/backoff/backoff.go
hlts2 acc4711
deleted import path
hlts2 5003cbb
fix backoff counting point
hlts2 1a90ecc
fix lint warning
hlts2 e4fc27f
deleted ctxkey package
hlts2 d1c5e7e
deleted space
hlts2 e1dc9d5
store grpc method name to context
hlts2 a925c68
fix countup bug
hlts2 6d5261b
Update pkg/manager/index/service/indexer.go
hlts2 e92afd7
make format
hlts2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
package backoff | ||
|
||
import "context" | ||
|
||
type contextKey string | ||
|
||
const backoffNameContextKey contextKey = "backoff_name" | ||
|
||
// WithBackoffName returns a copy of parent in which the method associated with key (backoffNameContextKey). | ||
func WithBackoffName(ctx context.Context, name string) context.Context { | ||
return context.WithValue(ctx, backoffNameContextKey, name) | ||
} | ||
|
||
// FromBackoffName returns the value associated with this context for key (backoffNameContextKey). | ||
func FromBackoffName(ctx context.Context) string { | ||
if val := ctx.Value(backoffNameContextKey); val != nil { | ||
return val.(string) | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright (C) 2019-2022 vdaas.org vald team <[email protected]> | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
package grpc | ||
|
||
import "context" | ||
|
||
type contextKey string | ||
|
||
const grpcMethodContextKey contextKey = "grpc_method" | ||
|
||
// WithGRPCMethod returns a copy of parent in which the method associated with key (grpcMethodContextKey). | ||
func WithGRPCMethod(ctx context.Context, method string) context.Context { | ||
return context.WithValue(ctx, grpcMethodContextKey, method) | ||
} | ||
|
||
// FromGRPCMethod returns the value associated with this context for key (grpcMethodContextKey). | ||
func FromGRPCMethod(ctx context.Context) string { | ||
if v := ctx.Value(grpcMethodContextKey); v != nil { | ||
return v.(string) | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 🐶
ST1000: package comment should be of the form "Package backoff ..." (stylecheck)