Conversation
|
Added istio/istio PR |
|
|
||
| message Params { | ||
| message Quota { | ||
| option (gogoproto.goproto_getters) = true; |
There was a problem hiding this comment.
Need getters so we can abstract over Quota and Override message.
They both implement
interface {
GetValidDuration()
GetMaxAmount()
}
|
|
||
| if qu.Logger.VerbosityLevel(4) { | ||
| if len(t) > 0 && qu.Logger.VerbosityLevel(4) { | ||
| qu.Logger.Infof("Running repear to reclaim %d old deduplication entries", len(t)) |
There was a problem hiding this comment.
let's also fix: "repear" -> "reaper"
There was a problem hiding this comment.
How do we keep ending up with this change being removed? This is at least the third time.
There was a problem hiding this comment.
This PR can now remove the entire adapter, but I will send a separate PR for that.
| // matchDimensions matches configured dimensions with dimensions of the instance. | ||
| func matchDimensions(cfg map[string]string, inst map[string]interface{}) bool { | ||
| for k, val := range cfg { | ||
| rval := inst[k] |
There was a problem hiding this comment.
so, this requires the dimensions to be in the same order as well, right?
There was a problem hiding this comment.
This is a map lookup - it shouldn't impose ordering constraints, right?
There was a problem hiding this comment.
Not really. we are checking all dimensions specified in adapterConfig. They can appear in any order.
There was a problem hiding this comment.
ah, ok. i was looking too quickly while trying to participate in that meeting.
| func limit(cfg *config.Params_Quota, instance *quota.Instance) Limit { | ||
| for idx := range cfg.Overrides { | ||
| o := cfg.Overrides[idx] | ||
| if matchDimensions(o.Dimensions, instance.Dimensions) { |
There was a problem hiding this comment.
don't the MakeKey() methods provide a set of functionality we could use instead of matchDimensions? Is there a reason not to use the existing Key funcs?
There was a problem hiding this comment.
MakeKey() creates a unique key using all dimensions.
matchDimensions needs to match on partial dimensions.
pkg/api/grpcServer.go
Outdated
| } | ||
| } | ||
|
|
||
| if glog.V(2) { |
There was a problem hiding this comment.
do we want this section of code? Doesn't this imply dimensions that might not be on the quota descriptor? For instance, I might not choose to dimension quota with source.name.
There was a problem hiding this comment.
regardless of quota dimensioning, I want accessLog to convey just some reasonable notion of source and target, how much quota was requested and how much was granted.
There was a problem hiding this comment.
+1, I don't like this chunk. If we want this kind of logging, just log "allocated %d tokens along dimensions: %v". Don't hard code attributes anywhere.
There was a problem hiding this comment.
I just log destination.service along with quota response now.
I also log full dimensions at log level 2.
| if inst.Name != qma.Quota { | ||
| continue | ||
| } | ||
| // if inst.Name != qma.Quota { |
There was a problem hiding this comment.
what is the harm in leaving this check enabled?
There was a problem hiding this comment.
It will not work. The qma.Name == RequestCount, however instance names in config are fully qualified. So mixer client will have to send the specific fully qualified name over.
testdata/config/quota.yaml
Outdated
| @@ -17,7 +23,7 @@ metadata: | |||
| spec: | |||
| dimensions: | |||
| source: source.labels["app"] | "unknown" | |||
There was a problem hiding this comment.
with the raw vm work, i'm wondering if we should switch from labels to source.service (at least for 0.2).
There was a problem hiding this comment.
how about source.labels["app"] | source.service
There was a problem hiding this comment.
how about source.labels["app"] | source.service | "unknown" to cover all bases?
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: douglas-reid The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
* Add overrides to memquota2 * change access log, reduce logs * remove adapter/kubernetes/kubeconfig added my mistake * make linter happy
This PR adds override support to memquota2 as
back end configurationwith the intention of migrating then to individual config resources in 0.3It gains feature parity with the old memquota setup + old config model.
This lets Mixer switch off old quota dispatch after creating replacement test configurations.
Release note:
This change is