Open junhuangli opened 1 year ago
The other behavior is the following metrics stuck in number "454211". Does anyone have this experience before?
otelcol_receiver_accepted_metric_points{receiver="jmx",service_instance_id="***",service_name="refinery",service_version="v0.3.0",transport="grpc"} 454211
Found the following error
2023-05-09T19:19:58.474Z debug subprocess/subprocess.go:287 java.lang.OutOfMemoryError: Java heap space {"kind": "receiver", "name": "jmx", "pipeline": "metrics"}
@junhuangli were you able to increase the heap space and resolve the issue?
Thanks for taking a look at this @trask. This OutOfMemoryError only shows up when I set the collection_interval to 1s. Since the waiting time is long(from 10 hours to 10 days) I am not sure if I wait long enough will I see the same error with the longer collection_interval yet. The current workaround is to set the collection_interval to 5 minutes.
I suspect, there might be a leaking somewhere.
The other tricky part is I am using https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/jmxreceiver which calls "[OpenTelemetry JMX Metric Gatherer]" to get JMX/Cassandra metrics. So I am not sure how I can control the resource usage here.
@breedx-splk @dehaansa @Mrod1598 @rmfitzpatrick do you know if it's possible to configure -Xmx
via the collector configuration? (and what the default, if any, is?)
From what I can recall, and a quick parse of the source, the collector does not support setting -Xmx
or the other various memory flags from the JMX receiver. In the interest of minimizing the potential attack surface while allowing the JMX receiver to be one of the last points of subprocess execution in the collector, there is very limited support for configuring the way the java process runs. The default value will be the default value of -Xmx
for your particular collector host, which can be found in JVM documentation.
The most vulnerable part of the JMX receiver as far as code execution goes is that it runs the java
command without specifying an absolute path, so you could feasibly take advantage of this vulnerability in the receiver to add a script named java
to the PATH of the user running the collector that would run java
with the desired parameters. As this is technically an example of exploiting a vulnerability in the collector, I'm not going to provide an example.
I can try but it is still kind of a workaround.
One more info, I am running the receiver in aws kubernetes as a sidecar container. And this situation is consistently happening.
This issue might be related to JMXGatherer memory leak issue we are experiencing.. #926
Thanks @smamidala1 , will follow #926
Thanks @dehaansa !
Description
Steps to reproduce Deploy and then wait
Expectation Jvm/Cassandra metrics continue flowing
What applicable config did you use?
Relevant Environment Information NAME="CentOS Linux" VERSION="7 (Core)" ID="centos"
Additional context