# How to set the "MaxCallRecvMsgSize" of APM server?

**URL:** <https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485>\
**Category:** APM\
**Tags:** go, server\
**Created:** [August 25, 2021, 12:24pm UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485 "2021-08-25T12:24:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tttoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tttoad/32/91162_2.png) [@tttoad](https://discuss.elastic.co/u/tttoad)\
**Post date:** [August 25, 2021, 12:24pm UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/1 "2021-08-25T12:24:20Z")

</div>

openTelemetry: otlp/elastic  
rpc error: code = ResourceExhausted desc = grpc :received message larger than max (5454409 vs. 4194304)  
How to set the "MaxCallRecvMsgSize" of APM server?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [August 25, 2021, 12:50pm UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/2 "2021-08-25T12:50:13Z")

</div>

The server uses the default size, 4MB, and it can't currently be configured.

Are you using opentelemetry-collector to send data? If so, you might want to set the `send_batch_size` property to limit the payload size (see [opentelemetry-collector/processor/batchprocessor at main · open-telemetry/opentelemetry-collector](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor))

---

<div class="post-metadata">

**Author:** ![tttoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tttoad/32/91162_2.png) [@tttoad](https://discuss.elastic.co/u/tttoad)\
**Post date:** [August 26, 2021, 3:39am UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/3 "2021-08-26T03:39:49Z")

</div>

This configuration does not work.

```auto
    send_batch_size: 1
    send_batch_max_size: 2
    timeout: 10s

```

 ![57244538-B0E9-4DCB-A68C-A1E256D155FE](https://us1.discourse-cdn.com/elastic/original/3X/2/9/29365d9e4129f93df7555ebd13fa9bf4ff309673.jpeg)

maybe the metric of "[go.opentelemetry.io/contrib/instrumentation/runtime](http://go.opentelemetry.io/contrib/instrumentation/runtime)" too large

```auto
	// start go pprof metric observation
		if err = runtime.Start(runtimeOption...); err != nil {
			return nil, errors.Wrap(err, "failed to start runtime metric observation")
		}

```

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [August 26, 2021, 5:29am UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/4 "2021-08-26T05:29:15Z")

</div>

> maybe the metric of "[go.opentelemetry.io/contrib/instrumentation/runtime](http://go.opentelemetry.io/contrib/instrumentation/runtime)" too large

Maybe. It seems to me that if the payload is reaching 4MB, then there's probably some runaway payload growth happening either in the OpenTelemetry SDK or OpenTelemetry Collector. I'm reluctant to just go and add configuration to increase the max size without first understanding why this is happening.

Any chance you can provide a small program that reproduces the issue?

---

<div class="post-metadata">

**Author:** ![tttoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tttoad/32/91162_2.png) [@tttoad](https://discuss.elastic.co/u/tttoad)\
**Post date:** [August 26, 2021, 7:30am UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/5 "2021-08-26T07:30:04Z")

</div>

I haven't reproduced the problem yet.  
The bug is in the business's application and I don't have access to their code.  
When I have time, I'll write a demo to see if I can reproduce it.

---

<div class="post-metadata">

**Author:** ![tttoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tttoad/32/91162_2.png) [@tttoad](https://discuss.elastic.co/u/tttoad)\
**Post date:** [August 26, 2021, 8:16am UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/6 "2021-08-26T08:16:10Z")

</div>

I checked the history logs and found that this error occurred 6 hours after the service was started. There should be a bug causing the data to pile up, not a single metric with too much data.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 16, 2021, 4:16am UTC](https://discuss.elastic.co/t/how-to-set-the-maxcallrecvmsgsize-of-apm-server/282485/7 "2021-09-16T04:16:36Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
