-
Notifications
You must be signed in to change notification settings - Fork 823
fix panic when using cassandra in multiple periodic configs or as a store for both index and delete requests #2774
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
Merged
pracucci
merged 8 commits into
cortexproject:master
from
sandeepsukhani:cassandra-clients-singleton
Jul 23, 2020
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
454ffc6
add purpose label to metric being used for tracing cassandra session …
sandeepsukhani 0a2e2f2
update changelog
sandeepsukhani 361fdd7
passing registerer wrapped with purpose to index client factory funct…
sandeepsukhani b69195a
add registerer for metrics in dynamodb clients
sandeepsukhani 8a3e8ac
changes suggested from PR review
sandeepsukhani df15535
minor nit
sandeepsukhani 7d701ef
changes suggested from PR review
sandeepsukhani 690d7cc
Merge branch 'master' into cassandra-clients-singleton
pracucci 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 hidden or 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 hidden or 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,60 @@ | ||
package aws | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
"github.com/weaveworks/common/instrument" | ||
) | ||
|
||
type dynamoDBMetrics struct { | ||
dynamoRequestDuration *instrument.HistogramCollector | ||
dynamoConsumedCapacity *prometheus.CounterVec | ||
dynamoThrottled *prometheus.CounterVec | ||
dynamoFailures *prometheus.CounterVec | ||
dynamoDroppedRequests *prometheus.CounterVec | ||
dynamoQueryPagesCount prometheus.Histogram | ||
} | ||
|
||
func newMetrics(r prometheus.Registerer) *dynamoDBMetrics { | ||
m := dynamoDBMetrics{} | ||
|
||
m.dynamoRequestDuration = instrument.NewHistogramCollector(promauto.With(r).NewHistogramVec(prometheus.HistogramOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_request_duration_seconds", | ||
Help: "Time spent doing DynamoDB requests.", | ||
|
||
// DynamoDB latency seems to range from a few ms to a several seconds and is | ||
// important. So use 9 buckets from 1ms to just over 1 minute (65s). | ||
Buckets: prometheus.ExponentialBuckets(0.001, 4, 9), | ||
}, []string{"operation", "status_code"})) | ||
m.dynamoConsumedCapacity = promauto.With(r).NewCounterVec(prometheus.CounterOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_consumed_capacity_total", | ||
Help: "The capacity units consumed by operation.", | ||
}, []string{"operation", tableNameLabel}) | ||
m.dynamoThrottled = promauto.With(r).NewCounterVec(prometheus.CounterOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_throttled_total", | ||
Help: "The total number of throttled events.", | ||
}, []string{"operation", tableNameLabel}) | ||
m.dynamoFailures = promauto.With(r).NewCounterVec(prometheus.CounterOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_failures_total", | ||
Help: "The total number of errors while storing chunks to the chunk store.", | ||
}, []string{tableNameLabel, errorReasonLabel, "operation"}) | ||
m.dynamoDroppedRequests = promauto.With(r).NewCounterVec(prometheus.CounterOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_dropped_requests_total", | ||
Help: "The total number of requests which were dropped due to errors encountered from dynamo.", | ||
}, []string{tableNameLabel, errorReasonLabel, "operation"}) | ||
m.dynamoQueryPagesCount = promauto.With(r).NewHistogram(prometheus.HistogramOpts{ | ||
Namespace: "cortex", | ||
Name: "dynamo_query_pages_count", | ||
Help: "Number of pages per query.", | ||
// Most queries will have one page, however this may increase with fuzzy | ||
// metric names. | ||
Buckets: prometheus.ExponentialBuckets(1, 4, 6), | ||
}) | ||
|
||
return &m | ||
} |
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.