[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Standalone JVM Monitoring plugin\n\nCloud Monitoring can monitor Java Virtual Machine processes for common\nJava metrics.\n\nThis functionality is only available for agents running on Linux. It is\nnot available on Windows.\n| **Note:** You can now collect metrics from your Java Virtual Machine instance using the [Ops Agent](/stackdriver/docs/solutions/agents/ops-agent), the primary and preferred agent for collecting telemetry from your Compute Engine instances. For details, see [configuring the Ops Agent for\n| JVM](/stackdriver/docs/solutions/agents/ops-agent/third-party/jvm).\n\nDiscovery\n---------\n\nTo see the metrics for Java Virtual Machine, do the following:\n\n1. In the Google Cloud console, go to the **Dashboards** page:\n\n [Go to **Dashboards**](https://console.cloud.google.com/monitoring/dashboards)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. Select the **Java Virtual Machine** dashboard from the list.\n\nConfiguring Monitoring to monitor Java VMs\n------------------------------------------\n\n| **Note:** You do not have to install this plugin if you install one of the Java-based plugins listed in the [Discovery](#discovery) section.\n\nAfter you [install the monitoring agent](/monitoring/agent/monitoring/installation),\nuse the following instructions to configure the JVM plugin on your instances.\n\n### Prerequisites\n\nThe JVM plugin requires version 5.5.0-257 or later of the monitoring agent.\nTo update the agent, see [Upgrading the agent](/monitoring/agent/monitoring/installation#upgrade).\n\n### Enabling the JVM monitoring plugin\n\nJava Virtual Machines are monitored via\n[JMX](http://www.oracle.com/technetwork/articles/java/javamanagement-140525.html).\n\nOn your VM instance, download [jvm-sun-hotspot.conf](https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/jvm-sun-hotspot.conf)\nfrom the [GitHub configuration repository](https://github.com/Stackdriver/stackdriver-agent-service-configs)\nand place it in the directory `/etc/stackdriver/collectd.d/`: \n\n (cd /etc/stackdriver/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/jvm-sun-hotspot.conf)\n\nAs **root** , edit the downloaded configuration file and replace `JMX_PORT` by\nthe port on which your JVM is configured to allow JMX connections.\n\nAfter adding the configuration file, restart the monitoring agent by running the\nfollowing command: \n\n sudo service stackdriver-agent restart\n\nFor more information on the `collectd` `GenericJMX` plugin used to monitor\nthe JVM, see [Plugin:GenericJMX](https://collectd.org/wiki/index.php/Plugin:GenericJMX).\n\nWhat is monitored\n-----------------\n\nThe full list of metrics the JVM plugin monitors is at\n[Agent metrics: jvm](/monitoring/api/metrics_agent#agent-jvm).\n\nAny additional JMX metrics (MBean attributes) *must* be sent to\nCloud Monitoring as user-defined metrics. For more information, see\n[User-defined metrics from the agent](/monitoring/agent/custom-metrics-agent).\nAny user-supplied MBeans added to the configuration that are not redirected to\nuser-defined metrics are rejected by the API."]]