Skip to content

Commit

Permalink
Adddress comments on doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ying-jeanne committed Jul 3, 2024
1 parent 1ba1bcb commit 51e14cd
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* `-ingest-storage.read-consistency`: configures the default read consistency.
* `-ingest-storage.migration.distributor-send-to-ingesters-enabled`: enabled tee-ing writes to classic ingesters and Kafka, used during a live migration to the new ingest storage architecture.
* `-ingester.partition-ring.*`: configures partitions ring backend.
* [ENHANCEMENT] Distributor: Add configuration option `-distributor.max-otlp-request-size` to limit otel decompressed write request byte sizes. #8574
* [ENHANCEMENT] Distributor: Add configuration option `-distributor.max-otlp-request-size` to limit OTel decompressed write request byte sizes. #8574
* [ENHANCEMENT] Compactor: Add `cortex_compactor_compaction_job_duration_seconds` and `cortex_compactor_compaction_job_blocks` histogram metrics to track duration of individual compaction jobs and number of blocks per job. #8371
* [ENHANCEMENT] Rules: Added per namespace max rules per rule group limit. The maximum number of rules per rule groups for all namespaces continues to be configured by `-ruler.max-rules-per-rule-group`, but now, this can be superseded by the new `-ruler.max-rules-per-rule-group-by-namespace` option on a per namespace basis. This new limit can be overridden using the overrides mechanism to be applied per-tenant. #8378
* [ENHANCEMENT] Rules: Added per namespace max rule groups per tenant limit. The maximum number of rule groups per rule tenant for all namespaces continues to be configured by `-ruler.max-rule-groups-per-tenant`, but now, this can be superseded by the new `-ruler.max-rule-groups-per-tenant-by-namespace` option on a per namespace basis. This new limit can be overridden using the overrides mechanism to be applied per-tenant. #8425
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/config-descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
"kind": "field",
"name": "max_otlp_request_size",
"required": false,
"desc": "Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit will be rejected.",
"desc": "Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit are rejected.",
"fieldValue": null,
"fieldDefaultValue": 83886080,
"fieldFlag": "distributor.max-otlp-request-size",
Expand Down
2 changes: 1 addition & 1 deletion cmd/mimir/help-all.txt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ Usage of ./cmd/mimir/mimir:
-distributor.max-exemplars-per-series-per-request int
[experimental] Maximum number of exemplars per series per request. 0 to disable limit in request. The exceeding exemplars are dropped.
-distributor.max-otlp-request-size int
[experimental] Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit will be rejected. (default 83886080)
[experimental] Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit are rejected. (default 83886080)
-distributor.max-recv-msg-size int
Max message size in bytes that the distributors will accept for incoming push requests to the remote write API. If exceeded, the request will be rejected. (default 104857600)
-distributor.max-request-pool-buffer-size int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ ha_tracker:
[max_recv_msg_size: <int> | default = 104857600]
# (experimental) Maximum OTLP request size in bytes that the distributors
# accept. Requests exceeding this limit will be rejected.
# accept. Requests exceeding this limit are rejected.
# CLI flag: -distributor.max-otlp-request-size
[max_otlp_request_size: <int> | default = 83886080]
Expand Down
2 changes: 1 addition & 1 deletion pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger) {
cfg.RetryConfig.RegisterFlags(f)

f.IntVar(&cfg.MaxRecvMsgSize, "distributor.max-recv-msg-size", 100<<20, "Max message size in bytes that the distributors will accept for incoming push requests to the remote write API. If exceeded, the request will be rejected.")
f.IntVar(&cfg.MaxOTLPRequestSize, maxOTLPRequestSizeFlag, 80<<20, "Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit will be rejected.")
f.IntVar(&cfg.MaxOTLPRequestSize, maxOTLPRequestSizeFlag, 80<<20, "Maximum OTLP request size in bytes that the distributors accept. Requests exceeding this limit are rejected.")
f.IntVar(&cfg.MaxRequestPoolBufferSize, "distributor.max-request-pool-buffer-size", 0, "Max size of the pooled buffers used for marshaling write requests. If 0, no max size is enforced.")
f.DurationVar(&cfg.RemoteTimeout, "distributor.remote-timeout", 2*time.Second, "Timeout for downstream ingesters.")
f.BoolVar(&cfg.WriteRequestsBufferPoolingEnabled, "distributor.write-requests-buffer-pooling-enabled", true, "Enable pooling of buffers used for marshaling write requests.")
Expand Down
6 changes: 3 additions & 3 deletions pkg/distributor/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func OTLPHandler(
protoBodySize, err := util.ParseProtoReader(ctx, reader, int(r.ContentLength), maxRecvMsgSize, buffers, unmarshaler, compression)
var tooLargeErr util.MsgSizeTooLargeErr
if errors.As(err, &tooLargeErr) {
return exportReq, 0, httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPWriteMessageSizeErr{
return exportReq, 0, httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{
actual: tooLargeErr.Actual,
limit: tooLargeErr.Limit,
}.Error())
Expand Down Expand Up @@ -119,7 +119,7 @@ func OTLPHandler(
reader = http.MaxBytesReader(nil, reader, int64(maxRecvMsgSize))
if _, err := buf.ReadFrom(reader); err != nil {
if util.IsRequestBodyTooLarge(err) {
return exportReq, 0, httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPWriteMessageSizeErr{
return exportReq, 0, httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{
actual: -1,
limit: maxRecvMsgSize,
}.Error())
Expand All @@ -138,7 +138,7 @@ func OTLPHandler(
// Check the request size against the message size limit, regardless of whether the request is compressed.
// If the request is compressed and its compressed length already exceeds the size limit, there's no need to decompress it.
if r.ContentLength > int64(maxRecvMsgSize) {
return httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPWriteMessageSizeErr{
return httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{
actual: int(r.ContentLength),
limit: maxRecvMsgSize,
}.Error())
Expand Down
4 changes: 2 additions & 2 deletions pkg/distributor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ func (e distributorMaxWriteMessageSizeErr) Error() string {
return globalerror.DistributorMaxWriteMessageSize.MessageWithPerInstanceLimitConfig(fmt.Sprintf("the incoming push request has been rejected because its message size%s is larger than the allowed limit of %d bytes", msgSizeDesc, e.limit), "distributor.max-recv-msg-size")
}

type distributorMaxOTLPWriteMessageSizeErr struct {
type distributorMaxOTLPRequestSizeErr struct {
actual, limit int
}

func (e distributorMaxOTLPWriteMessageSizeErr) Error() string {
func (e distributorMaxOTLPRequestSizeErr) Error() string {
msgSizeDesc := fmt.Sprintf(" of %d bytes", e.actual)
if e.actual < 0 {
msgSizeDesc = ""
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 51e14cd

Please sign in to comment.